From d86051ff82e60ed56841e857dfff6521337ab1a8 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 22 Jan 2014 13:40:24 -0500 Subject: [PATCH] bugfix: multiple drop handlers using same window no longer overwrite each other --- src/bin/e_dnd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index e5a469752..c6c26279f 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -111,7 +111,7 @@ e_dnd_init(void) _text_atom = ecore_x_atom_get("text/plain"); _drop_win_hash = eina_hash_int32_new(NULL); - _drop_handlers_responsives = eina_hash_string_superfast_new(NULL); + _drop_handlers_responsives = eina_hash_int32_new(NULL); E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_BUTTON_UP, _e_dnd_cb_mouse_up, NULL); E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_MOVE, _e_dnd_cb_mouse_move, NULL); @@ -509,18 +509,20 @@ EAPI void e_drop_handler_responsive_set(E_Drop_Handler *handler) { Ecore_X_Window hwin = _e_drag_win_get(handler, 1); - const char *wid = e_util_winid_str_get(hwin); + Eina_List *l; - eina_hash_add(_drop_handlers_responsives, wid, (void *)handler); + l = eina_hash_find(_drop_handlers_responsives, &hwin); + eina_hash_set(_drop_handlers_responsives, &hwin, eina_list_append(l, handler)); } EAPI int e_drop_handler_responsive_get(const E_Drop_Handler *handler) { Ecore_X_Window hwin = _e_drag_win_get(handler, 1); - const char *wid = e_util_winid_str_get(hwin); + Eina_List *l; - return eina_hash_find(_drop_handlers_responsives, wid) == (void *)handler; + l = eina_hash_find(_drop_handlers_responsives, &hwin); + return l && eina_list_data_find(l, handler); } EAPI void