inputgen: fix to release every wl_seat proxies 99/321699/2 accepted/tizen/unified/20250429.071334 accepted/tizen/unified/x/20250429.203618
authorduna.oh <duna.oh@samsung.com>
Thu, 27 Mar 2025 03:55:59 +0000 (12:55 +0900)
committerduna.oh <duna.oh@samsung.com>
Thu, 27 Mar 2025 04:01:01 +0000 (13:01 +0900)
If multiple wl_seat is bound, client should request a 'release' of every wl_seats.
This commit fixes the following errors.

...
Tried to add event to destroyed queue wl_seat@249

Change-Id: I8fdeb5141d9429d97685b721413ddbf997e26faf

src/efl_util.c

index 77ad0c79aa405f1f283e8a6005a3ccac8293a4a5..a4581c00ed931e792e34911164a87fa45cdc8ba5 100644 (file)
@@ -159,7 +159,7 @@ typedef struct _Efl_Util_Data
       struct
       {
          struct wl_event_queue *queue;
-         struct wl_seat *seat;
+         Eina_List *seat_list;
          struct tizen_input_device_manager *devicemgr;
          int request_notified;
          int max_touch_count;
@@ -578,7 +578,11 @@ _cb_wl_reg_devicemgr_global(void *data,
      }
    else if (strcmp(interface, "wl_seat") == 0)
      {
-        _eflutil.wl.devmgr.seat = wl_registry_bind(reg, id, &wl_seat_interface, version);
+        struct wl_seat *proto;
+        proto = wl_registry_bind(reg, id, &wl_seat_interface, version);
+        if (!proto) return;
+
+        _eflutil.wl.devmgr.seat_list = eina_list_append(_eflutil.wl.devmgr.seat_list, proto);
      }
 }
 
@@ -1503,13 +1507,16 @@ efl_util_input_set_touch_count(int max_count)
 static void
 _efl_util_wl_inputgen_deinit()
 {
-   if (_eflutil.wl.devmgr.seat)
+   struct wl_seat *proto;
+   Eina_List *l;
+
+   EINA_LIST_FOREACH (_eflutil.wl.devmgr.seat_list, l, proto)
      {
-        wl_seat_release(_eflutil.wl.devmgr.seat);
-        _eflutil.wl.devmgr.seat = NULL;
+        wl_seat_release(proto);
 
         wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.devmgr.queue);
      }
+   _eflutil.wl.devmgr.seat_list = eina_list_free(_eflutil.wl.devmgr.seat_list);
 
    if (_eflutil.wl.devmgr.devicemgr)
      {