summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-11-16 17:04:02 -0200
committerBruno Dilly <bdilly@profusion.mobi>2016-11-16 17:50:32 -0200
commit9f8e2e0d9c9b4150cce2fc9bfb825d4f49ba7840 (patch)
tree59c58bc086076ec341d4d9395966ebd02dcd1966 /src/modules
parent55ab71bd67429114557fb62a0ae01378aa098469 (diff)
Ecore Wayland: Remove ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT.
Summary: It's not possible to have an Ecore_Wl2_Input without a seat. Ecore Evas Wayland: Remove seat existence check. At this point every seat advertised is considered new, therefore it will not be in the devices list. Reviewers: barbieri, jpeg, cedric, bdilly Reviewed By: bdilly Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4408
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index 9184c6c384..2053c2167b 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -518,17 +518,18 @@ _ecore_evas_wl_common_device_event_add(int event_type, Ecore_Wl2_Device_Type dev
518 518
519static EE_Wl_Device * 519static EE_Wl_Device *
520_ecore_evas_wl_common_seat_add(Ecore_Evas *ee, 520_ecore_evas_wl_common_seat_add(Ecore_Evas *ee,
521 const char *seat_name,
522 unsigned int id) 521 unsigned int id)
523{ 522{
524 Ecore_Evas_Engine_Wl_Data *wdata; 523 Ecore_Evas_Engine_Wl_Data *wdata;
525 EE_Wl_Device *device; 524 EE_Wl_Device *device;
526 Evas_Device *dev; 525 Evas_Device *dev;
526 char buf[32];
527 527
528 device = calloc(1, sizeof(EE_Wl_Device)); 528 device = calloc(1, sizeof(EE_Wl_Device));
529 EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL); 529 EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
530 530
531 dev = evas_device_add_full(ee->evas, seat_name, "Wayland seat", 531 snprintf(buf, sizeof(buf), "seat-%u", id);
532 dev = evas_device_add_full(ee->evas, buf, "Wayland seat",
532 NULL, NULL, 533 NULL, NULL,
533 EVAS_DEVICE_CLASS_SEAT, 534 EVAS_DEVICE_CLASS_SEAT,
534 EVAS_DEVICE_SUBCLASS_NONE); 535 EVAS_DEVICE_SUBCLASS_NONE);
@@ -555,37 +556,17 @@ _ecore_evas_wl_common_cb_global_added(void *d EINA_UNUSED, int t EINA_UNUSED, vo
555 Ecore_Wl2_Event_Global *ev = event; 556 Ecore_Wl2_Event_Global *ev = event;
556 Ecore_Evas *ee; 557 Ecore_Evas *ee;
557 Eina_List *l; 558 Eina_List *l;
558 char buf[32];
559 559
560 if ((!ev->interface) || (strcmp(ev->interface, "wl_seat"))) 560 if ((!ev->interface) || (strcmp(ev->interface, "wl_seat")))
561 return ECORE_CALLBACK_PASS_ON; 561 return ECORE_CALLBACK_PASS_ON;
562 562
563 snprintf(buf, sizeof(buf), "seat-%u", ev->id);
564
565 EINA_LIST_FOREACH(ee_list, l, ee) 563 EINA_LIST_FOREACH(ee_list, l, ee)
566 { 564 {
567 Eina_List *ll; 565 if (!_ecore_evas_wl_common_seat_add(ee, ev->id))
568 EE_Wl_Device *device; 566 break;
569 Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
570 Eina_Bool already_present = EINA_FALSE;
571
572 EINA_LIST_FOREACH(wdata->devices_list, ll, device)
573 {
574 if (device->id == ev->id)
575 {
576 already_present = EINA_TRUE;
577 break;
578 }
579 }
580
581 if (!already_present && !_ecore_evas_wl_common_seat_add(ee, buf, ev->id))
582 goto err_add;
583 } 567 }
584 568
585 return ECORE_CALLBACK_PASS_ON; 569 return ECORE_CALLBACK_PASS_ON;
586
587err_add:
588 return ECORE_CALLBACK_PASS_ON;
589} 570}
590 571
591static void 572static void
@@ -2043,17 +2024,12 @@ _ecore_wl2_devices_setup(Ecore_Evas *ee, Ecore_Wl2_Display *display)
2043 { 2024 {
2044 EE_Wl_Device *device; 2025 EE_Wl_Device *device;
2045 Ecore_Wl2_Seat_Capabilities cap; 2026 Ecore_Wl2_Seat_Capabilities cap;
2046 char buf[32];
2047 unsigned int id; 2027 unsigned int id;
2048 2028
2049 id = ecore_wl2_input_seat_id_get(input); 2029 id = ecore_wl2_input_seat_id_get(input);
2050 cap = ecore_wl2_input_seat_capabilities_get(input); 2030 cap = ecore_wl2_input_seat_capabilities_get(input);
2051 //No seat, ignore... 2031 device = _ecore_evas_wl_common_seat_add(ee, id);
2052 if (cap == ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT)
2053 continue;
2054 2032
2055 snprintf(buf, sizeof(buf), "seat-%u", id);
2056 device = _ecore_evas_wl_common_seat_add(ee, buf, id);
2057 if (!device) 2033 if (!device)
2058 { 2034 {
2059 r = EINA_FALSE; 2035 r = EINA_FALSE;