From 7d6fd1052353c113340fd9f7891cf9d301bf1e73 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 22 Sep 2016 09:26:02 +0200 Subject: [PATCH] ecore_wl2: save action of data source in seperated field the drag.source is only available if the drag is happing inside the same client. So for the case there are two efl apps (A,B) , where A started the dnd and the B is currently entered by the dnd, then A has the data source, and B has the offer, if B sets a action on the offer A tried to set it on a field which does not exist there, this fixes that. It saves the action to a undepended field. --- src/lib/ecore_wl2/ecore_wl2_dnd.c | 10 ++++------ src/lib/ecore_wl2/ecore_wl2_private.h | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c b/src/lib/ecore_wl2/ecore_wl2_dnd.c index 628d25a71e..74299f3295 100644 --- a/src/lib/ecore_wl2/ecore_wl2_dnd.c +++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c @@ -153,8 +153,8 @@ data_source_event_emit(Ecore_Wl2_Input *input, int event) ev->source = input->focus.keyboard->id; if (!ev->win) ev->win = ev->source; - if (input->drag.source) - ev->action = input->drag.source->dnd_action; + + ev->action = input->data.action; ecore_event_add(event, ev, NULL, NULL); } @@ -164,9 +164,8 @@ data_source_cancelled(void *data, struct wl_data_source *source) { Ecore_Wl2_Input *input = data; - if (input->drag.source) - input->drag.source->dnd_action = 0; if (input->data.source == source) input->data.source = NULL; + input->data.action = WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE; wl_data_source_destroy(source); data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_END); } @@ -193,8 +192,7 @@ data_source_action(void *data, struct wl_data_source *source EINA_UNUSED, uint32 { Ecore_Wl2_Input *input = data; - if (input->drag.source) - input->drag.source->dnd_action = dnd_action; + input->data.action = dnd_action; data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_ACTION); } diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h index 59f63fce37..c15c6815da 100644 --- a/src/lib/ecore_wl2/ecore_wl2_private.h +++ b/src/lib/ecore_wl2/ecore_wl2_private.h @@ -345,6 +345,7 @@ struct _Ecore_Wl2_Input struct wl_data_device *device; struct wl_data_source *source; struct wl_array types; + uint32_t action; } data; struct