e_comp_wl: Remove list of focused when a focused client is destroyed 28/92928/3
authorJengHyun Kang <jhyuni.kang@samsung.com>
Wed, 19 Oct 2016 10:57:35 +0000 (19:57 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Fri, 28 Oct 2016 04:08:29 +0000 (21:08 -0700)
Change-Id: Ic6f4bc903328cc86c2998e0216be9f6f9d97b46e

src/bin/e_comp_wl.c

index ff15655704205eb6c0cede46a35ab132faaf4f6c..27e93fa535908f577947af1db4026415633c660a 100644 (file)
@@ -2943,12 +2943,15 @@ _e_comp_wl_surface_destroy(struct wl_resource *resource)
 
    if (!(ec = wl_resource_get_user_data(resource))) return;
 
-   EINA_LIST_FOREACH_SAFE(e_comp_wl->kbd.focused, l, ll, res)
+   if (ec == e_client_focused_get())
      {
-        if (wl_resource_get_client(res) ==
-            wl_resource_get_client(ec->comp_data->surface))
-          e_comp_wl->kbd.focused =
-             eina_list_remove_list(e_comp_wl->kbd.focused, l);
+        EINA_LIST_FOREACH_SAFE(e_comp_wl->kbd.focused, l, ll, res)
+          {
+             if (wl_resource_get_client(res) ==
+                 wl_resource_get_client(ec->comp_data->surface))
+               e_comp_wl->kbd.focused =
+                  eina_list_remove_list(e_comp_wl->kbd.focused, l);
+          }
      }
 
    ec->comp_data->surface = NULL;