summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
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
commit05fd3771e7996acdf2a21c1f235ef7feecca0005 (patch)
tree69aa202084e95aef6876bb987bd6227663635a94 /src/lib/ecore_wl2/ecore_wl2_input.c
parent1a7279f72eb0335c74d1fdeb62f67b88582d034c (diff)
ecore-wl2: add display object to all events
this is required in order to determine which connection an event originated from
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index f7fea1296d..9c7f5d959a 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -408,6 +408,16 @@ _ecore_wl2_input_mouse_up_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window,
408 _input_event_cb_free, ev->dev); 408 _input_event_cb_free, ev->dev);
409} 409}
410 410
411static void
412_input_event_focus_cb_free(void *data, void *event)
413{
414 Ecore_Wl2_Event_Focus_In *ev = event;
415 if (data)
416 efl_unref(data);
417 ecore_wl2_display_disconnect(ev->display);
418 free(event);
419}
420
411void 421void
412_ecore_wl2_input_focus_in_send(Ecore_Wl2_Window *window) 422_ecore_wl2_input_focus_in_send(Ecore_Wl2_Window *window)
413{ 423{
@@ -423,7 +433,9 @@ _ecore_wl2_input_focus_in_send(Ecore_Wl2_Window *window)
423 ev->timestamp = input->timestamp; 433 ev->timestamp = input->timestamp;
424 ev->window = window->id; 434 ev->window = window->id;
425 ev->dev = _ecore_wl2_seat_dev_get(input, window->id); 435 ev->dev = _ecore_wl2_seat_dev_get(input, window->id);
426 ecore_event_add(ECORE_WL2_EVENT_FOCUS_IN, ev, _input_event_cb_free, 436 ev->display = input->display;
437 ev->display->refs++;
438 ecore_event_add(ECORE_WL2_EVENT_FOCUS_IN, ev, _input_event_focus_cb_free,
427 ev->dev); 439 ev->dev);
428} 440}
429 441
@@ -442,7 +454,9 @@ _ecore_wl2_input_focus_out_send(Ecore_Wl2_Window *window)
442 ev->timestamp = input->timestamp; 454 ev->timestamp = input->timestamp;
443 ev->window = window->id; 455 ev->window = window->id;
444 ev->dev = _ecore_wl2_seat_dev_get(input, window->id); 456 ev->dev = _ecore_wl2_seat_dev_get(input, window->id);
445 ecore_event_add(ECORE_WL2_EVENT_FOCUS_OUT, ev, _input_event_cb_free, 457 ev->display = input->display;
458 ev->display->refs++;
459 ecore_event_add(ECORE_WL2_EVENT_FOCUS_OUT, ev, _input_event_focus_cb_free,
446 ev->dev); 460 ev->dev);
447} 461}
448 462
@@ -1260,8 +1274,10 @@ _seat_cb_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability
1260 ev->pointer_enabled = !!(caps & WL_SEAT_CAPABILITY_POINTER); 1274 ev->pointer_enabled = !!(caps & WL_SEAT_CAPABILITY_POINTER);
1261 ev->keyboard_enabled = !!(caps & WL_SEAT_CAPABILITY_KEYBOARD); 1275 ev->keyboard_enabled = !!(caps & WL_SEAT_CAPABILITY_KEYBOARD);
1262 ev->touch_enabled = !!(caps & WL_SEAT_CAPABILITY_TOUCH); 1276 ev->touch_enabled = !!(caps & WL_SEAT_CAPABILITY_TOUCH);
1277 ev->display = input->display;
1278 ev->display->refs++;
1263 1279
1264 ecore_event_add(ECORE_WL2_EVENT_SEAT_CAPABILITIES_CHANGED, ev, NULL, NULL); 1280 ecore_event_add(ECORE_WL2_EVENT_SEAT_CAPABILITIES_CHANGED, ev, _display_event_free, ev->display);
1265} 1281}
1266 1282
1267static void 1283static void
@@ -1271,6 +1287,7 @@ _cb_seat_event_free(void *data EINA_UNUSED, void *event)
1271 1287
1272 ev = event; 1288 ev = event;
1273 eina_stringshare_del(ev->name); 1289 eina_stringshare_del(ev->name);
1290 ecore_wl2_display_disconnect(ev->display);
1274 free(ev); 1291 free(ev);
1275} 1292}
1276 1293
@@ -1288,6 +1305,8 @@ _seat_cb_name(void *data, struct wl_seat *seat EINA_UNUSED, const char *name)
1288 1305
1289 ev->id = input->id; 1306 ev->id = input->id;
1290 ev->name = eina_stringshare_add(name); 1307 ev->name = eina_stringshare_add(name);
1308 ev->display = input->display;
1309 ev->display->refs++;
1291 1310
1292 ecore_event_add(ECORE_WL2_EVENT_SEAT_NAME_CHANGED, ev, 1311 ecore_event_add(ECORE_WL2_EVENT_SEAT_NAME_CHANGED, ev,
1293 _cb_seat_event_free, NULL); 1312 _cb_seat_event_free, NULL);