e_comp_wl : fix not to append a wl_keyboard resource into the comp's focused list... 79/106779/2
authorSung-Jin Park <sj76.park@samsung.com>
Fri, 23 Dec 2016 04:05:47 +0000 (13:05 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Fri, 23 Dec 2016 05:09:44 +0000 (14:09 +0900)
As of now, a wl_keyboard resource can be appended in the comp's focused list in
duplicate. When it comes to sending a key event to the focused client, duplicated
events will be sent to the same client. This change fixes this kind of problem.

Change-Id: I662fdcdc0655ee2e2faa6a872ffec1bf56ee76c6
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/bin/e_comp_wl.c

index 15d3d3bbd5ee486288e9851cad6c6c479a50103a..2d8cca8ec4dabf1f2acafedd6e31bfcaa73975ed 100644 (file)
@@ -1643,9 +1643,16 @@ e_comp_wl_feed_focus_in(E_Client *ec)
    _e_comp_wl_client_priority_raise(ec);
 
    wc = wl_resource_get_client(ec->comp_data->surface);
+
    EINA_LIST_FOREACH(e_comp_wl->kbd.resources, l, res)
-      if (wl_resource_get_client(res) == wc)
-        e_comp_wl->kbd.focused = eina_list_append(e_comp_wl->kbd.focused, res);
+     {
+        if (wl_resource_get_client(res) == wc)
+          {
+             if (!eina_list_data_find(e_comp_wl->kbd.focused, res))
+               e_comp_wl->kbd.focused = eina_list_append(e_comp_wl->kbd.focused, res);
+          }
+     }
+
    if (!e_comp_wl->kbd.focused) return;
    e_comp_wl_input_keyboard_enter_send(ec);
    e_comp_wl_data_device_keyboard_focus_set();