From 4f2a8b8679ba630d9ced874352650d2f548f979f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 12 May 2017 12:08:32 -0400 Subject: [PATCH] ecore-wl2: add seat id to most events seat id is required in order to handle multiseat environments --- src/lib/ecore_wl2/Ecore_Wl2.h | 9 +++++++++ src/lib/ecore_wl2/ecore_wl2_dnd.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 3c8039b..0203f04 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -103,12 +103,14 @@ typedef struct _Ecore_Wl2_Event_Dnd_Enter unsigned int win, source; Ecore_Wl2_Offer *offer; int x, y; + unsigned int seat; } Ecore_Wl2_Event_Dnd_Enter; typedef struct _Ecore_Wl2_Event_Dnd_Leave { unsigned int win, source; Ecore_Wl2_Offer *offer; + unsigned int seat; } Ecore_Wl2_Event_Dnd_Leave; typedef struct _Ecore_Wl2_Event_Dnd_Motion @@ -116,6 +118,7 @@ typedef struct _Ecore_Wl2_Event_Dnd_Motion unsigned int win, source; Ecore_Wl2_Offer *offer; int x, y; + unsigned int seat; } Ecore_Wl2_Event_Dnd_Motion; typedef struct _Ecore_Wl2_Event_Dnd_Drop @@ -123,17 +126,20 @@ typedef struct _Ecore_Wl2_Event_Dnd_Drop unsigned int win, source; int x, y; Ecore_Wl2_Offer *offer; + unsigned int seat; } Ecore_Wl2_Event_Dnd_Drop; typedef struct _Ecore_Wl2_Event_Dnd_End { unsigned int win, source; + unsigned int seat; } Ecore_Wl2_Event_Dnd_End; struct _Ecore_Wl2_Event_Data_Source_Event { unsigned int win, source; Ecore_Wl2_Drag_Action action; + unsigned int seat; uint32_t serial; }; @@ -144,12 +150,14 @@ typedef struct _Ecore_Wl2_Event_Data_Source_Event Ecore_Wl2_Event_Data_Source_Ac typedef struct _Ecore_Wl2_Event_Data_Source_Target { char *type; + unsigned int seat; } Ecore_Wl2_Event_Data_Source_Target; typedef struct _Ecore_Wl2_Event_Data_Source_Send { char *type; int fd; + unsigned int seat; uint32_t serial; } Ecore_Wl2_Event_Data_Source_Send; @@ -219,6 +227,7 @@ typedef struct _Ecore_Wl2_Event_Offer_Data_Ready char *data; int len; const char *mimetype; + unsigned int seat; } Ecore_Wl2_Event_Offer_Data_Ready; typedef enum _Ecore_Wl2_Window_Type diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c b/src/lib/ecore_wl2/ecore_wl2_dnd.c index d86f482..d00349e 100644 --- a/src/lib/ecore_wl2/ecore_wl2_dnd.c +++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c @@ -94,6 +94,7 @@ data_source_target(void *data, struct wl_data_source *source EINA_UNUSED, const ev = calloc(1, sizeof(Ecore_Wl2_Event_Data_Source_Target)); if (!ev) return; + ev->seat = input->id; if (mime_type) ev->type = strdup(mime_type); @@ -128,6 +129,7 @@ data_source_send(void *data, struct wl_data_source *source, const char *mime_typ ev->fd = fd; ev->type = strdup(mime_type); + ev->seat = input->id; if (source == input->data.selection.source) ev->serial = input->data.selection.serial; else @@ -145,6 +147,8 @@ event_fill(struct _Ecore_Wl2_Event_Data_Source_Event *ev, Ecore_Wl2_Input *input ev->win = _win_id_get(input); ev->action = input->data.drag.action; + ev->seat = input->id; + ev->serial = input->data.drag.serial; } static void @@ -264,6 +268,7 @@ _ecore_wl2_dnd_enter(Ecore_Wl2_Input *input, struct wl_data_offer *offer, struct ev->x = x; ev->y = y; ev->offer = input->drag; + ev->seat = input->id; ecore_event_add(ECORE_WL2_EVENT_DND_ENTER, ev, _unset_serial, input->drag); } @@ -293,6 +298,7 @@ _ecore_wl2_dnd_leave(Ecore_Wl2_Input *input) ev->win = input->drag->window_id; ev->offer = input->drag; ev->offer->ref++; + ev->seat = input->id; input->drag->window_id = 0; ecore_event_add(ECORE_WL2_EVENT_DND_LEAVE, ev, _delay_offer_destroy, ev->offer); @@ -319,6 +325,7 @@ _ecore_wl2_dnd_motion(Ecore_Wl2_Input *input, int x, int y, uint32_t serial) ev->x = x; ev->y = y; ev->offer = input->drag; + ev->seat = input->id; ecore_event_add(ECORE_WL2_EVENT_DND_MOTION, ev, _unset_serial, input->drag); } @@ -338,6 +345,7 @@ _ecore_wl2_dnd_drop(Ecore_Wl2_Input *input) ev->x = input->pointer.sx; ev->y = input->pointer.sy; ev->offer = input->drag; + ev->seat = input->id; ecore_event_add(ECORE_WL2_EVENT_DND_DROP, ev, NULL, NULL); } @@ -755,6 +763,7 @@ _offer_receive_fd_cb(void *data, Ecore_Fd_Handler *fdh) ev->data = buf->data; ev->len = buf->len; ev->mimetype = buf->mimetype; + ev->seat = buf->offer->input->id; ecore_event_add(ECORE_WL2_EVENT_OFFER_DATA_READY, ev, _free_buf, buf); buf->offer->reads = eina_list_remove(buf->offer->reads, fdh); -- 2.7.4