bdilly pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9f8e2e0d9c9b4150cce2fc9bfb825d4f49ba7840

commit 9f8e2e0d9c9b4150cce2fc9bfb825d4f49ba7840
Author: Guilherme Iscaro <isc...@profusion.mobi>
Date:   Wed Nov 16 17:04:02 2016 -0200

    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
---
 src/lib/ecore_wl2/Ecore_Wl2.h                      |  9 +++---
 src/lib/ecore_wl2/ecore_wl2_input.c                |  4 +--
 .../engines/wayland/ecore_evas_wayland_common.c    | 36 ++++------------------
 3 files changed, 11 insertions(+), 38 deletions(-)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 2d3cc16..9dcae3a 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -56,11 +56,10 @@ typedef enum
 
 typedef enum
 {
-  ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT = 0,
-  ECORE_WL2_SEAT_CAPABILITIES_NONE = 1,
-  ECORE_WL2_SEAT_CAPABILITIES_POINTER = 2,
-  ECORE_WL2_SEAT_CAPABILITIES_KEYBOARD = 4,
-  ECORE_WL2_SEAT_CAPABILITIES_TOUCH = 8
+  ECORE_WL2_SEAT_CAPABILITIES_NONE = 0,
+  ECORE_WL2_SEAT_CAPABILITIES_POINTER = 1,
+  ECORE_WL2_SEAT_CAPABILITIES_KEYBOARD = 2,
+  ECORE_WL2_SEAT_CAPABILITIES_TOUCH = 4
 } Ecore_Wl2_Seat_Capabilities;
 
 struct _Ecore_Wl2_Event_Connection
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c 
b/src/lib/ecore_wl2/ecore_wl2_input.c
index c7829f8..3df8f46 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1589,10 +1589,8 @@ ecore_wl2_input_seat_capabilities_get(Ecore_Wl2_Input 
*input)
 
    Ecore_Wl2_Seat_Capabilities cap = ECORE_WL2_SEAT_CAPABILITIES_NONE;
 
-   EINA_SAFETY_ON_NULL_RETURN_VAL(input, ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(input, cap);
 
-   if (!input->wl.seat)
-     return ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT;
    if (input->wl.keyboard)
      cap |= ECORE_WL2_SEAT_CAPABILITIES_KEYBOARD;
    if (input->wl.pointer)
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 9184c6c..2053c21 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
 
 static EE_Wl_Device *
 _ecore_evas_wl_common_seat_add(Ecore_Evas *ee,
-                               const char *seat_name,
                                unsigned int id)
 {
    Ecore_Evas_Engine_Wl_Data *wdata;
    EE_Wl_Device *device;
    Evas_Device *dev;
+   char buf[32];
 
    device = calloc(1, sizeof(EE_Wl_Device));
    EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
 
-   dev = evas_device_add_full(ee->evas, seat_name, "Wayland seat",
+   snprintf(buf, sizeof(buf), "seat-%u", id);
+   dev = evas_device_add_full(ee->evas, buf, "Wayland seat",
                               NULL, NULL,
                               EVAS_DEVICE_CLASS_SEAT,
                               EVAS_DEVICE_SUBCLASS_NONE);
@@ -555,37 +556,17 @@ _ecore_evas_wl_common_cb_global_added(void *d 
EINA_UNUSED, int t EINA_UNUSED, vo
    Ecore_Wl2_Event_Global *ev = event;
    Ecore_Evas *ee;
    Eina_List *l;
-   char buf[32];
 
    if ((!ev->interface) || (strcmp(ev->interface, "wl_seat")))
        return ECORE_CALLBACK_PASS_ON;
 
-   snprintf(buf, sizeof(buf), "seat-%u", ev->id);
-
    EINA_LIST_FOREACH(ee_list, l, ee)
      {
-        Eina_List *ll;
-        EE_Wl_Device *device;
-        Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
-        Eina_Bool already_present = EINA_FALSE;
-
-        EINA_LIST_FOREACH(wdata->devices_list, ll, device)
-          {
-             if (device->id == ev->id)
-               {
-                  already_present = EINA_TRUE;
-                  break;
-               }
-          }
-
-        if (!already_present && !_ecore_evas_wl_common_seat_add(ee, buf, 
ev->id))
-          goto err_add;
+        if (!_ecore_evas_wl_common_seat_add(ee, ev->id))
+          break;
      }
 
    return ECORE_CALLBACK_PASS_ON;
-
-err_add:
-   return ECORE_CALLBACK_PASS_ON;
 }
 
 static void
@@ -2043,17 +2024,12 @@ _ecore_wl2_devices_setup(Ecore_Evas *ee, 
Ecore_Wl2_Display *display)
      {
         EE_Wl_Device *device;
         Ecore_Wl2_Seat_Capabilities cap;
-        char buf[32];
         unsigned int id;
 
         id = ecore_wl2_input_seat_id_get(input);
         cap = ecore_wl2_input_seat_capabilities_get(input);
-        //No seat, ignore...
-        if (cap == ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT)
-          continue;
+        device = _ecore_evas_wl_common_seat_add(ee, id);
 
-        snprintf(buf, sizeof(buf), "seat-%u", id);
-        device = _ecore_evas_wl_common_seat_add(ee, buf, id);
         if (!device)
           {
              r = EINA_FALSE;

-- 


Reply via email to