devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0e9a691d6253744ca9fe84a2b8ad34b8f0188c1b
commit 0e9a691d6253744ca9fe84a2b8ad34b8f0188c1b Author: vivek <[email protected]> Date: Fri Sep 19 08:42:49 2014 -0400 Ecore_Wayland: Raise a event when data source cancelled Summary: 1) Created a event struct for data source cancel event 2) Raise a event when data source is cancelled Signed-off-by: vivek <[email protected]> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1465 --- src/lib/ecore_wayland/Ecore_Wayland.h | 7 +++++++ src/lib/ecore_wayland/ecore_wl_dnd.c | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index 5a8dcf3..455f0a7 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h @@ -59,6 +59,7 @@ typedef struct _Ecore_Wl_Event_Dnd_Position Ecore_Wl_Event_Dnd_Position; typedef struct _Ecore_Wl_Event_Dnd_Leave Ecore_Wl_Event_Dnd_Leave; typedef struct _Ecore_Wl_Event_Dnd_Drop Ecore_Wl_Event_Dnd_Drop; typedef struct _Ecore_Wl_Event_Dnd_End Ecore_Wl_Event_Dnd_End; +typedef struct _Ecore_Wl_Event_Data_Source_Cancelled Ecore_Wl_Event_Data_Source_Cancelled; /** @since 1.12 */ typedef struct _Ecore_Wl_Event_Data_Source_Send Ecore_Wl_Event_Data_Source_Send; /** @since 1.7 */ typedef struct _Ecore_Wl_Event_Selection_Data_Ready Ecore_Wl_Event_Selection_Data_Ready; /** @since 1.7 */ typedef struct _Ecore_Wl_Event_Interfaces_Bound Ecore_Wl_Event_Interfaces_Bound; @@ -183,6 +184,12 @@ struct _Ecore_Wl_Event_Dnd_End unsigned int win, source; }; +/** @since 1.12 */ +struct _Ecore_Wl_Event_Data_Source_Cancelled +{ + unsigned int win, source; +}; + /** @since 1.7 */ struct _Ecore_Wl_Event_Data_Source_Send { diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c b/src/lib/ecore_wayland/ecore_wl_dnd.c index 7136ba5..c816e9d 100644 --- a/src/lib/ecore_wayland/ecore_wl_dnd.c +++ b/src/lib/ecore_wayland/ecore_wl_dnd.c @@ -767,14 +767,24 @@ static void _ecore_wl_dnd_source_cb_cancelled(void *data, struct wl_data_source *source) { Ecore_Wl_Input *input; + Ecore_Wl_Event_Data_Source_Cancelled *ev; LOGFN(__FILE__, __LINE__, __FUNCTION__); if (!(input = data)) return; - /* FIXME: Raise an Ecore_Wl_Event here */ wl_data_source_destroy(source); if (input->data_source == source) input->data_source = NULL; + + if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Data_Source_Cancelled)))) return; + + if (input->pointer_focus) + ev->win = input->pointer_focus->id; + + if (input->keyboard_focus) + ev->source = input->keyboard_focus->id; + + ecore_event_add(ECORE_WL_EVENT_DATA_SOURCE_CANCELLED, ev, NULL, NULL); } static void --
