summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2016-10-04 15:19:51 -0300
committerBruno Dilly <bdilly@profusion.mobi>2016-11-01 16:06:19 -0200
commitd7b1a5dfebfee95e77c4c4f2037755b75b7be908 (patch)
tree11afbb17b16436a840933a5dea9805d6b6e79abb /src/lib
parent44fc1c6eccd98fa0b7353a89863da4c0f3973818 (diff)
ecore_wl2: add ecore event for seat name change
And handle it on ecore_evas/wayland, properly setting the evas device names.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h7
-rw-r--r--src/lib/ecore_wl2/ecore_wl2.c3
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c29
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h1
4 files changed, 36 insertions, 4 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 30fb5d97b5..19c9965ede 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -139,6 +139,12 @@ typedef struct _Ecore_Wl2_Event_Data_Source_Send
139 int fd; 139 int fd;
140} Ecore_Wl2_Event_Data_Source_Send; 140} Ecore_Wl2_Event_Data_Source_Send;
141 141
142typedef struct _Ecore_Wl2_Event_Seat_Name
143{
144 Eina_Stringshare *name;
145 unsigned int id;
146} Ecore_Wl2_Event_Seat_Name;
147
142typedef enum 148typedef enum
143{ 149{
144 ECORE_WL2_SELECTION_CNP, 150 ECORE_WL2_SELECTION_CNP,
@@ -203,6 +209,7 @@ EAPI extern int ECORE_WL2_EVENT_DATA_SOURCE_SEND; /** @since 1.17 */
203EAPI extern int ECORE_WL2_EVENT_WINDOW_CONFIGURE; /** @since 1.17 */ 209EAPI extern int ECORE_WL2_EVENT_WINDOW_CONFIGURE; /** @since 1.17 */
204EAPI extern int ECORE_WL2_EVENT_SYNC_DONE; /** @since 1.17 */ 210EAPI extern int ECORE_WL2_EVENT_SYNC_DONE; /** @since 1.17 */
205EAPI extern int ECORE_WL2_EVENT_OFFER_DATA_READY; /** @since 1.19 */ 211EAPI extern int ECORE_WL2_EVENT_OFFER_DATA_READY; /** @since 1.19 */
212EAPI extern int ECORE_WL2_EVENT_SEAT_NAME_CHANGED; /** @since 1.19 */
206/** 213/**
207 * @file 214 * @file
208 * @brief Ecore functions for dealing with the Wayland display protocol 215 * @brief Ecore functions for dealing with the Wayland display protocol
diff --git a/src/lib/ecore_wl2/ecore_wl2.c b/src/lib/ecore_wl2/ecore_wl2.c
index 397f8e3f16..ceb6dce80f 100644
--- a/src/lib/ecore_wl2/ecore_wl2.c
+++ b/src/lib/ecore_wl2/ecore_wl2.c
@@ -31,6 +31,7 @@ EAPI int ECORE_WL2_EVENT_DATA_SOURCE_SEND = 0;
31EAPI int ECORE_WL2_EVENT_WINDOW_CONFIGURE = 0; 31EAPI int ECORE_WL2_EVENT_WINDOW_CONFIGURE = 0;
32EAPI int ECORE_WL2_EVENT_SYNC_DONE = 0; 32EAPI int ECORE_WL2_EVENT_SYNC_DONE = 0;
33EAPI int ECORE_WL2_EVENT_OFFER_DATA_READY = 0; 33EAPI int ECORE_WL2_EVENT_OFFER_DATA_READY = 0;
34EAPI int ECORE_WL2_EVENT_SEAT_NAME_CHANGED = 0;
34 35
35EAPI int _ecore_wl2_event_window_www = -1; 36EAPI int _ecore_wl2_event_window_www = -1;
36EAPI int _ecore_wl2_event_window_www_drag = -1; 37EAPI int _ecore_wl2_event_window_www_drag = -1;
@@ -89,6 +90,7 @@ ecore_wl2_init(void)
89 ECORE_WL2_EVENT_WINDOW_CONFIGURE = ecore_event_type_new(); 90 ECORE_WL2_EVENT_WINDOW_CONFIGURE = ecore_event_type_new();
90 ECORE_WL2_EVENT_SYNC_DONE = ecore_event_type_new(); 91 ECORE_WL2_EVENT_SYNC_DONE = ecore_event_type_new();
91 ECORE_WL2_EVENT_OFFER_DATA_READY = ecore_event_type_new(); 92 ECORE_WL2_EVENT_OFFER_DATA_READY = ecore_event_type_new();
93 ECORE_WL2_EVENT_SEAT_NAME_CHANGED = ecore_event_type_new();
92 _ecore_wl2_event_window_www = ecore_event_type_new(); 94 _ecore_wl2_event_window_www = ecore_event_type_new();
93 _ecore_wl2_event_window_www_drag = ecore_event_type_new(); 95 _ecore_wl2_event_window_www_drag = ecore_event_type_new();
94 } 96 }
@@ -140,6 +142,7 @@ ecore_wl2_shutdown(void)
140 ECORE_WL2_EVENT_WINDOW_CONFIGURE = 0; 142 ECORE_WL2_EVENT_WINDOW_CONFIGURE = 0;
141 ECORE_WL2_EVENT_SYNC_DONE = 0; 143 ECORE_WL2_EVENT_SYNC_DONE = 0;
142 ECORE_WL2_EVENT_OFFER_DATA_READY = 0; 144 ECORE_WL2_EVENT_OFFER_DATA_READY = 0;
145 ECORE_WL2_EVENT_SEAT_NAME_CHANGED = 0;
143 146
144 /* shutdown Ecore_Event */ 147 /* shutdown Ecore_Event */
145 ecore_event_shutdown(); 148 ecore_event_shutdown();
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index b89e3e1484..36013fba05 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1188,11 +1188,31 @@ _seat_cb_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability
1188} 1188}
1189 1189
1190static void 1190static void
1191_seat_cb_name(void *data EINA_UNUSED, struct wl_seat *seat EINA_UNUSED, const char *name EINA_UNUSED) 1191_cb_seat_event_free(void *data EINA_UNUSED, void *event)
1192{ 1192{
1193 /* NB: No-Op as we don't care about seat name right now. 1193 Ecore_Wl2_Event_Seat_Name *ev;
1194 * 1194
1195 * This will likely change as we hash out remaining multi-seat issues */ 1195 ev = event;
1196 eina_stringshare_del(ev->name);
1197 free(ev);
1198}
1199
1200static void
1201_seat_cb_name(void *data, struct wl_seat *seat EINA_UNUSED, const char *name)
1202{
1203 Ecore_Wl2_Event_Seat_Name *ev;
1204 Ecore_Wl2_Input *input;
1205
1206 input = data;
1207
1208 ev = calloc(1, sizeof(Ecore_Wl2_Event_Seat_Name));
1209 EINA_SAFETY_ON_NULL_RETURN(ev);
1210
1211 ev->id = input->id;
1212 ev->name = eina_stringshare_add(name);
1213
1214 ecore_event_add(ECORE_WL2_EVENT_SEAT_NAME_CHANGED, ev,
1215 _cb_seat_event_free, NULL);
1196} 1216}
1197 1217
1198static const struct wl_seat_listener _seat_listener = 1218static const struct wl_seat_listener _seat_listener =
@@ -1241,6 +1261,7 @@ _ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id, unsigned int v
1241 input = calloc(1, sizeof(Ecore_Wl2_Input)); 1261 input = calloc(1, sizeof(Ecore_Wl2_Input));
1242 if (!input) return; 1262 if (!input) return;
1243 1263
1264 input->id = id;
1244 input->display = display; 1265 input->display = display;
1245 input->seat_version = version; 1266 input->seat_version = version;
1246 input->repeat.rate = 0.025; 1267 input->repeat.rate = 0.025;
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h
index ab619aa3c5..30f9d88473 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -405,6 +405,7 @@ struct _Ecore_Wl2_Input
405 Ecore_Wl2_Offer *drag, *selection; 405 Ecore_Wl2_Offer *drag, *selection;
406 406
407 unsigned int seat_version; 407 unsigned int seat_version;
408 unsigned int id;
408}; 409};
409 410
410typedef struct Ecore_Wl2_Event_Window_WWW 411typedef struct Ecore_Wl2_Event_Window_WWW