tinyds: Fix not sendig all seat capabilities 67/279467/1
authorSeunghun <chwila927@gmail.com>
Fri, 5 Aug 2022 07:12:00 +0000 (16:12 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 10 Aug 2022 04:24:16 +0000 (13:24 +0900)
The capabilities passing ds_seat_seat_capabilities should be set
bitwise.

Change-Id: Idb292124c14731560ad8fb16491ae2a9e1bbe0e5

examples/tinyds.c

index 382332b..1154f0b 100644 (file)
@@ -99,6 +99,8 @@ struct tinyds_server
     struct ds_seat *seat;
     struct ds_data_device_manager *data_device;
 
+    enum wl_seat_capability seat_caps;
+
     struct wl_list views;
 
     struct wl_listener display_destroy;
@@ -365,21 +367,21 @@ server_handle_new_input(struct wl_listener *listener, void *data)
     switch (dev_type) {
         case DS_INPUT_DEVICE_KEYBOARD:
             server_add_keyboard(server, dev);
-            ds_seat_set_capabilities(server->seat,
-                    WL_SEAT_CAPABILITY_KEYBOARD);
+            server->seat_caps |= WL_SEAT_CAPABILITY_KEYBOARD;
             break;
         case DS_INPUT_DEVICE_TOUCH:
             server_add_touch(server, dev);
             break;
         case DS_INPUT_DEVICE_POINTER:
             server_add_pointer(server, dev);
-            ds_seat_set_capabilities(server->seat,
-                    WL_SEAT_CAPABILITY_POINTER);
+            server->seat_caps |= WL_SEAT_CAPABILITY_POINTER;
             break;
         default:
             ds_err("Unknown type(%d) of ds_input_device", dev_type);
             break;
     }
+
+    ds_seat_set_capabilities(server->seat, server->seat_caps);
 }
 
 static void