From 408a3a94621a60986deb3031fd043308819c6692 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 8 May 2023 13:38:40 +1000 Subject: [PATCH] eis: drop the vestiges of client restrictions Leftover from 479bda259a79b198929df14eb89fe8a3dec40afe (and possibly others). This dates back to when a client could have restrictions configured on the same fd. This is now all out-of-band (portals!) so the compositor knows what the client is allowed to set up anyway. No need for this (read-only) API here. --- src/libeis-client.c | 25 ------------------------- src/libeis-client.h | 4 ---- test/test-eis.c | 22 ---------------------- 3 files changed, 51 deletions(-) diff --git a/src/libeis-client.c b/src/libeis-client.c index 700f615..bc06b4e 100644 --- a/src/libeis-client.c +++ b/src/libeis-client.c @@ -151,26 +151,6 @@ eis_client_is_sender(struct eis_client *client) return client->is_sender; } -_public_ bool -eis_client_has_capability(struct eis_client *client, - enum eis_device_capability cap) -{ - switch (cap) { - case EIS_DEVICE_CAP_POINTER: - case EIS_DEVICE_CAP_POINTER_ABSOLUTE: - case EIS_DEVICE_CAP_KEYBOARD: - case EIS_DEVICE_CAP_TOUCH: - case EIS_DEVICE_CAP_BUTTON: - case EIS_DEVICE_CAP_SCROLL: - return mask_all(client->restrictions.cap_allow_mask, cap); - } - - /* Quietly ignore other capabilities, we don't want to future-proof this */ - if (cap == 0) - log_bug_client(eis_client_get_context(client), "Check for invalid capability 0"); - return false; -} - int eis_client_send_message(struct eis_client *client, const struct brei_object *object, uint32_t opcode, const char *signature, size_t nargs, ...) @@ -479,11 +459,6 @@ eis_client_new(struct eis *eis, int fd) client->source = source_ref(s); client->state = EIS_CLIENT_STATE_NEW; - client->restrictions.cap_allow_mask = - EIS_DEVICE_CAP_KEYBOARD | - EIS_DEVICE_CAP_POINTER | - EIS_DEVICE_CAP_POINTER_ABSOLUTE | - EIS_DEVICE_CAP_TOUCH; eis_add_client(eis, eis_client_ref(client)); diff --git a/src/libeis-client.h b/src/libeis-client.h index be671e0..ec92da3 100644 --- a/src/libeis-client.h +++ b/src/libeis-client.h @@ -82,10 +82,6 @@ struct eis_client { struct list seats; struct list seats_pending; - - struct { - uint32_t cap_allow_mask; - } restrictions; }; OBJECT_DECLARE_GETTER(eis_client, client, struct eis_client *); diff --git a/test/test-eis.c b/test/test-eis.c index 4b93f3b..82b69b8 100644 --- a/test/test-eis.c +++ b/test/test-eis.c @@ -76,28 +76,6 @@ MUNIT_TEST(eistest_name) return MUNIT_OK; } -MUNIT_TEST(eistest_capabilities) -{ - _unref_(peck) *peck = peck_new(); - - peck_enable_eis_behavior(peck, PECK_EIS_BEHAVIOR_ACCEPT_CLIENT); - - peck_dispatch_until_stable(peck); - - with_server(peck) { - struct eis_client *client = peck_eis_get_default_client(peck); - - munit_assert_true(eis_client_has_capability(client, EIS_DEVICE_CAP_POINTER)); - munit_assert_true(eis_client_has_capability(client, EIS_DEVICE_CAP_TOUCH)); - munit_assert_true(eis_client_has_capability(client, EIS_DEVICE_CAP_KEYBOARD)); - munit_assert_true(eis_client_has_capability(client, EIS_DEVICE_CAP_POINTER_ABSOLUTE)); - munit_assert_false(eis_client_has_capability(client, 0)); - munit_assert_false(eis_client_has_capability(client, EIS_DEVICE_CAP_TOUCH + 1)); - } - - return MUNIT_OK; -} - MUNIT_TEST(eistest_cliend_bind_all_caps) { _unref_(peck) *peck = peck_new();