From 2be0a40129c3e59e29f8068827526cf4d9c0eed7 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Fri, 9 Oct 2015 11:41:07 -0400 Subject: [PATCH] ecore-wl2: Fix dnd to function when source window and target window are same Signed-off-by: Chris Michael --- src/lib/ecore_wl2/ecore_wl2_dnd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c b/src/lib/ecore_wl2/ecore_wl2_dnd.c index 13cc87b95e..e25222cdf3 100644 --- a/src/lib/ecore_wl2/ecore_wl2_dnd.c +++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c @@ -118,6 +118,8 @@ _source_cb_cancelled(void *data, struct wl_data_source *source) if (input->focus.keyboard) ev->source = input->focus.keyboard->id; + if (!ev->win) ev->win = ev->source; + ecore_event_add(ECORE_WL2_EVENT_DATA_SOURCE_CANCELLED, ev, NULL, NULL); } @@ -310,6 +312,8 @@ _ecore_wl2_dnd_enter(Ecore_Wl2_Input *input, struct wl_data_offer *offer, struct if (input->focus.keyboard) ev->source = input->focus.keyboard->id; + if (!ev->win) ev->win = ev->source; + ev->x = x; ev->y = y; ev->offer = offer; @@ -333,6 +337,8 @@ _ecore_wl2_dnd_leave(Ecore_Wl2_Input *input) if (input->focus.keyboard) ev->source = input->focus.keyboard->id; + if (!ev->win) ev->win = ev->source; + ecore_event_add(ECORE_WL2_EVENT_DND_LEAVE, ev, NULL, NULL); } @@ -352,6 +358,8 @@ _ecore_wl2_dnd_motion(Ecore_Wl2_Input *input, int x, int y, unsigned int timesta if (input->focus.keyboard) ev->source = input->focus.keyboard->id; + if (!ev->win) ev->win = ev->source; + ev->x = x; ev->y = y; ev->serial = timestamp; @@ -373,6 +381,8 @@ _ecore_wl2_dnd_drop(Ecore_Wl2_Input *input) ev->win = input->focus.pointer->id; if (input->focus.keyboard) ev->source = input->focus.keyboard->id; + + if (!ev->win) ev->win = ev->source; } ev->x = input->pointer.sx; @@ -523,6 +533,8 @@ ecore_wl2_dnd_drag_end(Ecore_Wl2_Input *input) if (input->focus.keyboard) ev->source = input->focus.keyboard->id; + if (!ev->win) ev->win = ev->source; + ecore_event_add(ECORE_WL2_EVENT_DND_END, ev, NULL, NULL); }