e_keyrouter: refactoring code of sending event_device
authorduna.oh <duna.oh@samsung.com>
Tue, 13 May 2025 11:53:26 +0000 (20:53 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 14 May 2025 02:03:21 +0000 (11:03 +0900)
Change-Id: Iea7d2570ebfadadeb19bc78b8cfb7299c0494bd3

src/bin/server/e_keyrouter_wl.c

index d128a8c6d9227c288033c0443e38a1160d870b6e..f31aecf4de8e942d303e9de7f1ffbdd066f6ebdf 100644 (file)
@@ -110,21 +110,22 @@ _e_keyrouter_wl_key_send(Ecore_Event_Key *ev, E_Device *dev, enum wl_keyboard_ke
         ELOGF("INPUT", "wl_keyboard_send_key:%s:%s|B|", NULL, (state ? "PRESS" : "RELEASE"), ev->keyname);
      }
 
+   if (!e_input_thread_mode_get())
+     {
+        e_comp_wl_send_event_device(client, ev->timestamp, ev->dev, serial);
+     }
+   else
+     {
+        if (dev)
+          e_comp_wl_send_event_e_device(client, ev->timestamp, dev, serial);
+     }
+
    EINA_LIST_FOREACH(key_list, l, res)
      {
         wc = wl_resource_get_client(res);
         if (!focused && wc != client) continue;
-        TRACE_INPUT_BEGIN(_e_comp_wl_key_send);
-        if (!e_input_thread_mode_get())
-          {
-             e_comp_wl_send_event_device(client, ev->timestamp, ev->dev, serial);
-          }
-        else
-          {
-             if (dev)
-               e_comp_wl_send_event_e_device(client, ev->timestamp, dev, serial);
-          }
 
+        TRACE_INPUT_BEGIN(_e_keyrouter_wl_key_send);
         if (comp_conf && comp_conf->input_log_enable)
           INF("[Server] Routed Key %s (time: %d)\n", (state ? "Down" : "Up"), ev->timestamp);