diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2017-05-12 12:08:32 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2017-05-12 12:08:25 -0400 |
commit | d119fdded93feaf13d2c9ea6ca47b4d84b57bb08 (patch) | |
tree | 4377fe9b87af52720593cc11a4720cd3b2e73761 | |
parent | 05fd3771e7996acdf2a21c1f235ef7feecca0005 (diff) | |
download | efl-d119fdded93feaf13d2c9ea6ca47b4d84b57bb08.tar.gz |
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
-rw-r--r-- | src/lib/ecore_wl2/Ecore_Wl2.h | 10 | ||||
-rw-r--r-- | src/lib/ecore_wl2/ecore_wl2_dnd.c | 19 |
2 files changed, 23 insertions, 6 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 1dbfbd4676..9c3e95994f 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 3c526941f9..132eeb3ebb 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 = |