diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index cefe97d2d..ac63aa012 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -96,9 +96,14 @@ typedef struct E_Comp_Wl_Extension_Data { struct { + struct wl_resource *global; struct wl_client *client; void (*read_pixels)(E_Comp_Wl_Output *output, void *pixels); } screenshooter; + struct + { + struct wl_resource *global; + } session_recovery; } E_Comp_Wl_Extension_Data; struct _E_Comp_Wl_Data diff --git a/src/bin/e_comp_wl_extensions.c b/src/bin/e_comp_wl_extensions.c index 5ee0091ff..57644ac80 100644 --- a/src/bin/e_comp_wl_extensions.c +++ b/src/bin/e_comp_wl_extensions.c @@ -81,7 +81,12 @@ static const struct screenshooter_interface _e_screenshooter_interface = _e_comp_wl_screenshooter_cb_shoot }; -#define GLOBAL_BIND_CB(NAME, IFACE) \ +#define GLOBAL_BIND_CB(NAME, IFACE, ...) \ +static void \ +_e_comp_wl_##NAME##_cb_unbind(struct wl_resource *resource EINA_UNUSED) \ +{ \ + e_comp_wl->extensions->NAME.global = NULL; \ +} \ static void \ _e_comp_wl_##NAME##_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t version EINA_UNUSED, uint32_t id) \ { \ @@ -94,7 +99,8 @@ _e_comp_wl_##NAME##_cb_bind(struct wl_client *client, void *data EINA_UNUSED, ui return;\ }\ \ - wl_resource_set_implementation(res, &_e_##NAME##_interface, NULL, NULL);\ + e_comp_wl->extensions->NAME.global = res; \ + wl_resource_set_implementation(res, &_e_##NAME##_interface, NULL, _e_comp_wl_##NAME##_cb_unbind);\ } GLOBAL_BIND_CB(session_recovery, zwp_e_session_recovery_interface)