discomfitor pushed a commit to branch enlightenment-0.18.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=a581f5566f0cd6d3a45918d4ea7abbdaa605f3e2

commit a581f5566f0cd6d3a45918d4ea7abbdaa605f3e2
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Wed Jan 22 13:40:24 2014 -0500

    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 52a3b7c..06f7914 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_string_superfast_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);
@@ -496,18 +496,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

-- 


Reply via email to