From f9bd731087c7da7d2d1712baaf2c29aeeff03011 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 7 Aug 2015 12:49:12 -0400 Subject: [PATCH] track xwl dnd event handlers --- src/modules/xwayland/dnd.c | 12 ++++++++++-- src/modules/xwayland/e_mod_main.c | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/modules/xwayland/dnd.c b/src/modules/xwayland/dnd.c index 69ae9b515..73636d7dd 100644 --- a/src/modules/xwayland/dnd.c +++ b/src/modules/xwayland/dnd.c @@ -10,6 +10,8 @@ static Ecore_X_Atom xwl_dnd_atom; static int32_t cur_fd = -1; +static Eina_List *handlers; + static void _xdnd_finish(Eina_Bool success) { @@ -193,10 +195,16 @@ dnd_init(void) { ecore_x_fixes_selection_notification_request(ecore_x_atom_get("CLIPBOARD")); ecore_x_fixes_selection_notification_request(ECORE_X_ATOM_SELECTION_XDND); - ecore_event_handler_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY, (Ecore_Event_Handler_Cb)_xwl_fixes_selection_notify, NULL); - ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, (Ecore_Event_Handler_Cb)_xwl_selection_notify, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_FIXES_SELECTION_NOTIFY, _xwl_fixes_selection_notify, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_SELECTION_NOTIFY, _xwl_selection_notify, NULL); xconvertselection = dlsym(NULL, "XConvertSelection"); string_atom = ecore_x_atom_get("UTF8_STRING"); xwl_dnd_atom = ecore_x_atom_get("E_XWL_DND_ATOM_HAHA"); e_comp_shape_queue(); } + +EINTERN void +dnd_shutdown(void) +{ + E_FREE_LIST(handlers, ecore_event_handler_del); +} diff --git a/src/modules/xwayland/e_mod_main.c b/src/modules/xwayland/e_mod_main.c index 8cacc27db..7bb78c113 100644 --- a/src/modules/xwayland/e_mod_main.c +++ b/src/modules/xwayland/e_mod_main.c @@ -4,6 +4,7 @@ #include EINTERN void dnd_init(void); +EINTERN void dnd_shutdown(void); /* local structures */ typedef struct _E_XWayland_Server E_XWayland_Server; @@ -407,6 +408,7 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED) char path[256]; if (!exs) return 1; + dnd_shutdown(); unlink(exs->lock);