Check whether the parent window is focused window or not in _e_input_panel_surface_cb... 72/140772/2
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 26 Jul 2017 08:45:01 +0000 (17:45 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 26 Jul 2017 10:51:05 +0000 (19:51 +0900)
Change-Id: I320441601823e0cfcc758273e22fd5dc5f8cca04

src/e_mod_input_panel.c

index 82e9997..2bad22f 100644 (file)
@@ -135,6 +135,7 @@ static void
 _e_input_panel_surface_cb_ready_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t state EINA_UNUSED)
 {
    E_Input_Panel_Surface *ips = wl_resource_get_user_data(resource);
+   E_Client *focused_ec = NULL;
 
    if (!g_input_panel) return;
 
@@ -148,9 +149,18 @@ _e_input_panel_surface_cb_ready_set(struct wl_client *client EINA_UNUSED, struct
 
    if (g_input_panel->wait_update)
      {
-        LOGD("IPS::SHOW::READY\n");
-        e_input_panel_visibility_change(EINA_TRUE);
+        focused_ec = e_client_focused_get();
+        LOGD("IPS::SHOW::READY (parent:%p, focus:%p)\n", ips->ec ? ips->ec->parent:NULL, focused_ec);
         e_input_panel_wait_update_set(EINA_FALSE);
+        if (ips->ec->parent)
+          {
+             if (ips->ec->parent == focused_ec)
+               e_input_panel_visibility_change(EINA_TRUE);
+             else
+               e_input_panel_visibility_change(EINA_FALSE);
+          }
+        else
+          e_input_panel_visibility_change(EINA_FALSE);
      }
 }