e_comp_wl : add subsurface update api 58/122358/10
authorSungbae Park <sb34.park@samsung.com>
Fri, 31 Mar 2017 05:49:33 +0000 (14:49 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Fri, 14 Apr 2017 07:13:30 +0000 (00:13 -0700)
if we call activate below api with below target surface is subsurface parent.
the target surface is trapped between parent subsurface and child subsurface.
because it. we need subsurface update api for e_policy and e20 module

Signed-off-by: Sungbae Park <sb34.park@samsung.com>
Change-Id: I5b159e9cd1ce92607f7f020927e24fc4f802d57c
Signed-off-by: Sungbae Park <sb34.park@samsung.com>
src/bin/e_comp_wl.c
src/bin/e_comp_wl.h
src/bin/e_policy_stack.c

index ddd076689131803e0276d370f1a1ba2eb43cb105..209c594ba60774d9d1a6efd7801f02296e8b1783 100644 (file)
@@ -681,53 +681,16 @@ _e_comp_wl_touch_cancel(void)
 static void
 _e_comp_wl_evas_cb_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
 {
-   E_Client *ec;
-   E_Client *topmost;
+   E_Client *ec = (E_Client *)data;
 
-   if (!(ec = data) || !ec->comp_data) return;
+   if ((!ec) || (!ec->comp_data)) return;
    if (e_object_is_del(E_OBJECT(ec))) return;
    if (ec->comp_data->sub.restacking) return;
 
    if (ec->visibility.obscured == E_VISIBILITY_FULLY_OBSCURED)
      _e_comp_wl_touch_cancel();
 
-   /* return if ec isn't both a parent of a subsurface and a subsurface itself */
-   if (!ec->comp_data->sub.list && !ec->comp_data->sub.below_list && !ec->comp_data->sub.data)
-     {
-        if (ec->comp_data->sub.below_obj)
-          _e_comp_wl_subsurface_restack_bg_rectangle(ec);
-        return;
-     }
-
-   topmost = _e_comp_wl_topmost_parent_get(ec);
-
-   _e_comp_wl_subsurface_restack(topmost);
-   _e_comp_wl_subsurface_restack_bg_rectangle(topmost);
-
-   //To update client stack list
-   if ((ec->comp_data->sub.data) &&
-       (ec->comp_data->sub.data->parent))
-     {
-        E_Client *parent;
-        Evas_Object *o;
-
-        parent = ec->comp_data->sub.data->parent;
-
-        if ((parent->comp_data->sub.list) &&
-            (eina_list_data_find(parent->comp_data->sub.list, ec)))
-          {
-             //stack above done
-             o = evas_object_below_get(ec->frame);
-             e_comp_object_layer_update(ec->frame, o, NULL);
-          }
-        else if ((parent->comp_data->sub.below_list) &&
-                 (eina_list_data_find(parent->comp_data->sub.below_list, ec)))
-          {
-             //stack below done
-             o = evas_object_above_get(ec->frame);
-             e_comp_object_layer_update(ec->frame, NULL, o);
-          }
-     }
+   e_comp_wl_subsurface_stack_update(ec);
 }
 
 static E_Comp_Wl_Input_Device *
@@ -1695,6 +1658,54 @@ e_comp_wl_feed_focus_in(E_Client *ec)
      e_pointer_rotation_set(e_comp->pointer, rotation);
 }
 
+E_API void
+e_comp_wl_subsurface_stack_update(E_Client *ec)
+{
+   E_Client *topmost;
+
+   if (!(ec) || !ec->comp_data) return;
+   if (e_object_is_del(E_OBJECT(ec))) return;
+   if (ec->comp_data->sub.restacking) return;
+
+   /* return if ec isn't both a parent of a subsurface and a subsurface itself */
+   if (!ec->comp_data->sub.list && !ec->comp_data->sub.below_list && !ec->comp_data->sub.data)
+     {
+        if (ec->comp_data->sub.below_obj)
+          _e_comp_wl_subsurface_restack_bg_rectangle(ec);
+        return;
+     }
+
+   topmost = _e_comp_wl_topmost_parent_get(ec);
+
+   _e_comp_wl_subsurface_restack(topmost);
+   _e_comp_wl_subsurface_restack_bg_rectangle(topmost);
+
+   //To update client stack list
+   if ((ec->comp_data->sub.data) &&
+       (ec->comp_data->sub.data->parent))
+     {
+        E_Client *parent;
+        Evas_Object *o;
+
+        parent = ec->comp_data->sub.data->parent;
+
+        if ((parent->comp_data->sub.list) &&
+            (eina_list_data_find(parent->comp_data->sub.list, ec)))
+          {
+             //stack above done
+             o = evas_object_below_get(ec->frame);
+             e_comp_object_layer_update(ec->frame, o, NULL);
+          }
+        else if ((parent->comp_data->sub.below_list) &&
+                 (eina_list_data_find(parent->comp_data->sub.below_list, ec)))
+          {
+             //stack below done
+             o = evas_object_above_get(ec->frame);
+             e_comp_object_layer_update(ec->frame, NULL, o);
+          }
+     }
+}
+
 static void
 _e_comp_wl_evas_cb_focus_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
 {
index c65510b063cb0ae2278a6176f469cff5273f0da5..d68543b2594a7a08f61e35562a2165bea3c70983 100644 (file)
@@ -554,6 +554,8 @@ EINTERN Eina_Bool e_comp_wl_cursor_hide(E_Client *ec);
 
 EINTERN void     e_comp_wl_feed_focus_in(E_Client *ec);
 
+E_API void e_comp_wl_subsurface_stack_update(E_Client *ec);
+
 E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD;
 
 # endif
index d008670ec085845bac7bb9f1d1882ea5b98ff01b..f4ecce685e9447aa9ebf360631bb8188a1f4f372 100644 (file)
@@ -319,6 +319,7 @@ e_policy_stack_below(E_Client *ec, E_Client *below_ec)
    EINA_SAFETY_ON_NULL_RETURN(below_ec->frame);
 
    evas_object_stack_below(ec->frame, below_ec->frame);
+   e_comp_wl_subsurface_stack_update(below_ec);
    if (e_config->transient.iconify)
      {
         E_Client *child;
@@ -341,6 +342,7 @@ e_policy_stack_above(E_Client *ec, E_Client *above_ec)
    EINA_SAFETY_ON_NULL_RETURN(above_ec->frame);
 
    evas_object_stack_above(ec->frame, above_ec->frame);
+   e_comp_wl_subsurface_stack_update(above_ec);
    if (e_config->transient.iconify)
      {
         E_Client *child;