e_policy_wl: added missing focus_in function call when launching image ec is replaced... 31/102931/6 accepted/tizen/3.0/common/20161207.195541 accepted/tizen/3.0/ivi/20161207.135437 accepted/tizen/3.0/mobile/20161207.135405 accepted/tizen/3.0/tv/20161207.135157 accepted/tizen/3.0/wearable/20161207.135453 accepted/tizen/common/20161207.184432 accepted/tizen/ivi/20161208.011708 accepted/tizen/mobile/20161208.011603 accepted/tizen/tv/20161208.011628 accepted/tizen/wearable/20161208.011650 submit/tizen/20161207.072438 submit/tizen_3.0/20161207.072141
authorGwanglim Lee <gl77.lee@samsung.com>
Wed, 7 Dec 2016 00:07:30 +0000 (09:07 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 7 Dec 2016 06:33:21 +0000 (22:33 -0800)
Change-Id: I69ef71c62ae566a32c051749affbc14cf6e57bf5

src/bin/e_comp_wl.c
src/bin/e_comp_wl.h
src/bin/e_policy_wl.c

index 472edd7a3bccc7449272fb7eb5e4a23e54bf8b57..d3a9c3a24b8f3cac9ea101e101c3ab655bc3267a 100644 (file)
@@ -1619,15 +1619,19 @@ _e_comp_wl_evas_cb_focus_in_timer(E_Client *ec)
    return EINA_FALSE;
 }
 
-static void
-_e_comp_wl_evas_cb_focus_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
+/* It is called in the following cases:
+ *  When a normal ec->frame has focus.
+ *  Or launching image ec is replaced to the real ec.
+ */
+EINTERN void
+e_comp_wl_feed_focus_in(E_Client *ec)
 {
-   E_Client *ec, *focused;
+   E_Client *focused;
    struct wl_resource *res;
    struct wl_client *wc;
    Eina_List *l;
 
-   if (!(ec = data)) return;
+   if (!ec) return;
    if (e_object_is_del(E_OBJECT(ec))) return;
    if (ec->iconic) return;
 
@@ -1653,6 +1657,14 @@ _e_comp_wl_evas_cb_focus_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
      e_pointer_rotation_set(e_comp->pointer, rotation);
 }
 
+static void
+_e_comp_wl_evas_cb_focus_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
+{
+   E_Client *ec;
+   if (!(ec = data)) return;
+   e_comp_wl_feed_focus_in(ec);
+}
+
 static void
 _e_comp_wl_evas_cb_focus_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
 {
index 6257e5a4a135c8e096fe67530ea68457dbe52dfa..105b1cb187a63f8eaea8ea43c01ae25ac747705a 100644 (file)
@@ -545,6 +545,8 @@ EINTERN Eina_Bool e_comp_wl_mouse_move_send(E_Client *ec, int x, int y, Ecore_De
 EINTERN Eina_Bool e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev, uint32_t time);
 EINTERN Eina_Bool e_comp_wl_cursor_hide(E_Client *ec);
 
+EINTERN void     e_comp_wl_feed_focus_in(E_Client *ec);
+
 E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD;
 
 # endif
index c24c6cb1f064efa6d4fa7e4e6004fb1fa38734df..c7c05a6063ec95ce9068299b2b5baf0ddf9d5a36 100644 (file)
@@ -139,6 +139,7 @@ typedef struct _E_Policy_Wl_Tzlaunch_Img
    Ecore_Timer               *timeout;          /* launch screen image hide timer */
 
    Eina_Bool                  valid;            /* validation check */
+   Eina_Bool                  replaced;
    E_Comp_Object_Content_Type content_type;     /* type of content */
 } E_Policy_Wl_Tzlaunch_Img;
 
@@ -4434,6 +4435,12 @@ _launchscreen_img_off(E_Policy_Wl_Tzlaunch_Img *tzlaunch_img)
         evas_object_hide(ec->frame);
      }
 
+   if (!tzlaunch_img->replaced)
+     {
+        if (ec->focused)
+          e_comp_wl_feed_focus_in(ec);
+     }
+
    e_comp->launchscrns = eina_list_remove(e_comp->launchscrns, ec);
 
    if (obj)
@@ -4444,6 +4451,7 @@ _launchscreen_img_off(E_Policy_Wl_Tzlaunch_Img *tzlaunch_img)
    if (tzlaunch_img->timeout) ecore_timer_del(tzlaunch_img->timeout);
    tzlaunch_img->timeout = NULL;
    tzlaunch_img->valid = EINA_FALSE;
+   tzlaunch_img->replaced = EINA_FALSE;
 }
 
 static Eina_Bool
@@ -4628,6 +4636,7 @@ _tzlaunch_img_iface_cb_owner(struct wl_client *client EINA_UNUSED, struct wl_res
              EC_CHANGED(new_ec);
 
              tzlaunch_img->ec = new_ec;
+             tzlaunch_img->replaced = EINA_TRUE;
 
              ELOGF("TZPOL",
                    "Launchscreen client changed | old(%p) new(%p) using obj(%p)",
@@ -4689,6 +4698,7 @@ _tzlaunch_img_add(struct wl_resource *res_tzlaunch, struct wl_resource *res_tzla
    tzlaunch_img->tzlaunch  = tzlaunch;
    tzlaunch_img->res_tzlaunch_img = res_tzlaunch_img;
 
+   tzlaunch_img->replaced = EINA_FALSE;
    tzlaunch_img->ep = e_pixmap_new(E_PIXMAP_TYPE_EXT_OBJECT, 0);
    EINA_SAFETY_ON_NULL_GOTO(tzlaunch_img->ep, error);
    tzlaunch_img->ec = e_client_new(tzlaunch_img->ep, 0, 1);