aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/wlr_input_inhibitor.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/types/wlr_input_inhibitor.c b/types/wlr_input_inhibitor.c
index f3385ef3..d42a5c0c 100644
--- a/types/wlr_input_inhibitor.c
+++ b/types/wlr_input_inhibitor.c
@@ -24,14 +24,6 @@ static void input_inhibitor_destroy(struct wl_client *client,
wl_signal_emit(&manager->events.deactivate, manager);
}
-static void input_manager_resource_destroy(struct wl_resource *resource) {
- struct wlr_input_inhibit_manager *manager =
- input_inhibit_manager_from_resource(resource);
- if (manager->active_client == wl_resource_get_client(resource)) {
- input_inhibitor_destroy(manager->active_client, resource);
- }
-}
-
static struct zwlr_input_inhibitor_v1_interface input_inhibitor_implementation = {
.destroy = input_inhibitor_destroy,
};
@@ -53,9 +45,8 @@ static void inhibit_manager_get_inhibitor(struct wl_client *client,
if (!wl_resource) {
wl_client_post_no_memory(client);
}
- wl_resource_set_implementation(wl_resource,
- &input_inhibitor_implementation, manager,
- input_manager_resource_destroy);
+ wl_resource_set_implementation(wl_resource, &input_inhibitor_implementation,
+ manager, NULL);
manager->active_client = client;
manager->active_inhibitor = wl_resource;
@@ -67,6 +58,14 @@ static const struct zwlr_input_inhibit_manager_v1_interface inhibit_manager_impl
.get_inhibitor = inhibit_manager_get_inhibitor
};
+static void input_manager_client_destroy(struct wl_resource *resource) {
+ struct wlr_input_inhibit_manager *manager =
+ input_inhibit_manager_from_resource(resource);
+ if (manager->active_client == wl_resource_get_client(resource)) {
+ input_inhibitor_destroy(manager->active_client, resource);
+ }
+}
+
static void inhibit_manager_bind(struct wl_client *wl_client, void *data,
uint32_t version, uint32_t id) {
struct wlr_input_inhibit_manager *manager = data;
@@ -80,7 +79,7 @@ static void inhibit_manager_bind(struct wl_client *wl_client, void *data,
}
wl_resource_set_implementation(wl_resource,
&inhibit_manager_implementation, manager,
- input_manager_resource_destroy);
+ input_manager_client_destroy);
}
void wlr_input_inhibit_manager_destroy(