summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-05-12 12:08:32 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-05-12 12:08:25 -0400
commit37ff7b43f11fcbc6859fe45584e34d72a13bef77 (patch)
treebd1a5f85f4c6a918a221409f9f767858e5fd7525
parentd51252a69ecbca30cc4c80b1358b3227778e948d (diff)
downloadefl-37ff7b43f11fcbc6859fe45584e34d72a13bef77.tar.gz
ecore-wl2: emit serials in selection-related events
these allow apps to match the serial of their selection to the related event in order to avoid mangling selections from other components
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h2
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_dnd.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index e7e59132b0..3c8039bd8b 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -134,6 +134,7 @@ struct _Ecore_Wl2_Event_Data_Source_Event
{
unsigned int win, source;
Ecore_Wl2_Drag_Action action;
+ uint32_t serial;
};
typedef struct _Ecore_Wl2_Event_Data_Source_Event Ecore_Wl2_Event_Data_Source_End;
@@ -149,6 +150,7 @@ typedef struct _Ecore_Wl2_Event_Data_Source_Send
{
char *type;
int fd;
+ uint32_t serial;
} Ecore_Wl2_Event_Data_Source_Send;
typedef struct _Ecore_Wl2_Event_Seat_Name
diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c b/src/lib/ecore_wl2/ecore_wl2_dnd.c
index 8a4f5df462..d86f482991 100644
--- a/src/lib/ecore_wl2/ecore_wl2_dnd.c
+++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c
@@ -110,11 +110,12 @@ data_source_send_free(void *data EINA_UNUSED, void *event)
if (!ev) return;
free(ev->type);
+ ecore_wl2_display_disconnect(ev->display);
free(ev);
}
static void
-data_source_send(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type, int32_t fd)
+data_source_send(void *data, struct wl_data_source *source, const char *mime_type, int32_t fd)
{
Ecore_Wl2_Input *input;
Ecore_Wl2_Event_Data_Source_Send *ev;
@@ -127,6 +128,10 @@ data_source_send(void *data, struct wl_data_source *source EINA_UNUSED, const ch
ev->fd = fd;
ev->type = strdup(mime_type);
+ if (source == input->data.selection.source)
+ ev->serial = input->data.selection.serial;
+ else
+ ev->serial = input->data.drag.serial;
ecore_event_add(ECORE_WL2_EVENT_DATA_SOURCE_SEND, ev,
data_source_send_free, NULL);