Revert "Add destructor to inhibitor"

This breaks shit

This reverts commit 657d2c9a69.
This commit is contained in:
Drew DeVault 2018-04-03 16:41:01 -04:00
parent 657d2c9a69
commit 1fa3ca3152

View file

@ -24,14 +24,6 @@ static void input_inhibitor_destroy(struct wl_client *client,
wl_signal_emit(&manager->events.deactivate, manager); 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 = { static struct zwlr_input_inhibitor_v1_interface input_inhibitor_implementation = {
.destroy = input_inhibitor_destroy, .destroy = input_inhibitor_destroy,
}; };
@ -53,9 +45,8 @@ static void inhibit_manager_get_inhibitor(struct wl_client *client,
if (!wl_resource) { if (!wl_resource) {
wl_client_post_no_memory(client); wl_client_post_no_memory(client);
} }
wl_resource_set_implementation(wl_resource, wl_resource_set_implementation(wl_resource, &input_inhibitor_implementation,
&input_inhibitor_implementation, manager, manager, NULL);
input_manager_resource_destroy);
manager->active_client = client; manager->active_client = client;
manager->active_inhibitor = wl_resource; 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 .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, static void inhibit_manager_bind(struct wl_client *wl_client, void *data,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_input_inhibit_manager *manager = data; 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, wl_resource_set_implementation(wl_resource,
&inhibit_manager_implementation, manager, &inhibit_manager_implementation, manager,
input_manager_resource_destroy); input_manager_client_destroy);
} }
void wlr_input_inhibit_manager_destroy( void wlr_input_inhibit_manager_destroy(