e_keyrouter: check a focused ec has wl_surface 19/180019/1
authorJengHyun Kang <jhyuni.kang@samsung.com>
Thu, 24 May 2018 06:45:14 +0000 (15:45 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Thu, 24 May 2018 06:45:14 +0000 (15:45 +0900)
Change-Id: Id779e404216188d1f8c4dc87cd5ba967e90eee95

src/bin/e_keyrouter.c

index 216b71d581092328902949564a49712fcccbd296..b231a72843d4fc2654fc42b7c0f3dd1870b856cd 100644 (file)
@@ -173,8 +173,17 @@ _e_keyrouter_keygrab_print(void *data, const char *log_path)
    if (ec_focus)
      {
         surface_focus = e_keyrouter_util_get_surface_from_eclient(ec_focus);
-        wc_focus = wl_resource_get_client(surface_focus);
-        pid_focus = e_keyrouter_util_get_pid(NULL, surface_focus);
+        if (surface_focus)
+          {
+             wc_focus = wl_resource_get_client(surface_focus);
+             pid_focus = e_keyrouter_util_get_pid(NULL, surface_focus);
+          }
+        else
+          {
+             wc_focus = NULL;
+             if (e_object_is_del(E_OBJECT(ec_focus))) pid_focus = 0;
+             else pid_focus = ec_focus->netwm.pid;
+          }
         cmd_focus = e_keyrouter_util_cmd_get_from_pid(pid_focus);
 
         fprintf(log_fl, "        Focus Client: E_Client: %p\n", ec_focus);