From: Mike Blumenkrantz Date: Fri, 12 May 2017 16:08:32 +0000 (-0400) Subject: ecore-wl2: add 'cancelled' to Ecore_Wl2_Event_Data_Source_End X-Git-Tag: upstream/1.20.0~1088 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d119fdded93feaf13d2c9ea6ca47b4d84b57bb08;p=platform%2Fupstream%2Fefl.git ecore-wl2: add 'cancelled' to Ecore_Wl2_Event_Data_Source_End it's impossible to know the result of a drag operation without this member --- diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 1dbfbd4..9c3e959 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -152,7 +152,15 @@ struct _Ecore_Wl2_Event_Data_Source_Event Ecore_Wl2_Display *display; }; -typedef struct _Ecore_Wl2_Event_Data_Source_Event Ecore_Wl2_Event_Data_Source_End; +typedef struct Ecore_Wl2_Event_Data_Source_End +{ + unsigned int win, source; + Ecore_Wl2_Drag_Action action; + unsigned int seat; + uint32_t serial; + Ecore_Wl2_Display *display; + Eina_Bool cancelled; +} Ecore_Wl2_Event_Data_Source_End; typedef struct _Ecore_Wl2_Event_Data_Source_Event Ecore_Wl2_Event_Data_Source_Drop; typedef struct _Ecore_Wl2_Event_Data_Source_Event Ecore_Wl2_Event_Data_Source_Action; diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c b/src/lib/ecore_wl2/ecore_wl2_dnd.c index 3c52694..132eeb3 100644 --- a/src/lib/ecore_wl2/ecore_wl2_dnd.c +++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c @@ -162,11 +162,20 @@ static void data_source_event_emit(Ecore_Wl2_Input *input, int event, Eina_Bool cancel) { struct _Ecore_Wl2_Event_Data_Source_Event *ev; + Ecore_Wl2_Event_Data_Source_End *ev2; - ev = calloc(1, sizeof(struct _Ecore_Wl2_Event_Data_Source_Event)); + if (event == ECORE_WL2_EVENT_DATA_SOURCE_END) + { + ev2 = calloc(1, sizeof(Ecore_Wl2_Event_Data_Source_End)); + ev = (void*)ev2; + } + else + ev = calloc(1, sizeof(struct _Ecore_Wl2_Event_Data_Source_Event)); EINA_SAFETY_ON_NULL_RETURN(ev); event_fill((void*)ev, input); + if (event == ECORE_WL2_EVENT_DATA_SOURCE_END) + ev2->cancelled = cancel; ecore_event_add(event, ev, _display_event_free, ev->display); } @@ -179,14 +188,14 @@ data_source_cancelled(void *data, struct wl_data_source *source) if (input->data.drag.source == source) input->data.drag.source = NULL; input->data.drag.action = WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE; wl_data_source_destroy(source); - data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_END); + data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_END, 1); } static void data_source_dnd_drop_performed(void *data, struct wl_data_source *source EINA_UNUSED) { Ecore_Wl2_Input *input = data; - data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_DROP); + data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_DROP, 0); } static void @@ -196,7 +205,7 @@ data_source_dnd_finished(void *data, struct wl_data_source *source) if (input->data.drag.source == source) input->data.drag.source = NULL; wl_data_source_destroy(source); - data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_END); + data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_END, 0); } static void @@ -205,7 +214,7 @@ data_source_action(void *data, struct wl_data_source *source EINA_UNUSED, uint32 Ecore_Wl2_Input *input = data; input->data.drag.action = dnd_action; - data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_ACTION); + data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_ACTION, 0); } static const struct wl_data_source_listener _source_listener =