Change the map state of pepper_view according to visible state of evas object. 65/69265/1
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 12 May 2016 08:28:00 +0000 (17:28 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Thu, 12 May 2016 08:52:06 +0000 (17:52 +0900)
this will unmap the pepper_view if pepper object is hidden.
as a result, stop sending the frame callback to client and then
client would not render its canvas.

Change-Id: Iece79af367409931a369275f30992e7045117101

src/lib/object.c
src/lib/shell.c

index a7234c8bb92ba54fd526557dfc901c8953fed96d..4525fe0bb77f3331f537fef4f996e9342ec714bf 100644 (file)
@@ -121,10 +121,26 @@ _pepper_efl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
 static void
 _pepper_efl_smart_show(Evas_Object *obj)
 {
+   pepper_efl_shell_surface_t *shsurf;
+
    OBJ_DATA_GET;
 
    DBG("[OBJECT] Show: obj %p", obj);
 
+   if (!po->surface)
+     return;
+
+   shsurf = pepper_object_get_user_data((pepper_object_t *)po->surface,
+                                        pepper_surface_get_role(po->surface));
+   if (!shsurf)
+     return;
+
+   if (!shsurf->mapped)
+     {
+        shsurf->mapped = EINA_TRUE;
+        pepper_view_map(shsurf->view);
+     }
+
    evas_object_show(po->img);
    evas_object_show(po->clip);
 }
@@ -132,10 +148,26 @@ _pepper_efl_smart_show(Evas_Object *obj)
 static void
 _pepper_efl_smart_hide(Evas_Object *obj)
 {
+   pepper_efl_shell_surface_t *shsurf;
+
    OBJ_DATA_GET;
 
    DBG("[OBJECT] Hide: obj %p", obj);
 
+   if (!po->surface)
+     return;
+
+   shsurf = pepper_object_get_user_data((pepper_object_t *)po->surface,
+                                        pepper_surface_get_role(po->surface));
+   if (!shsurf)
+     return;
+
+   if (shsurf->mapped)
+     {
+        shsurf->mapped = EINA_FALSE;
+        pepper_view_unmap(shsurf->view);
+     }
+
    evas_object_hide(po->img);
    evas_object_hide(po->clip);
 }
index f6d455119043e3567fb7d95ef276a34822a536cd..dedef6ae72e0edc342edb43a4988eb838d0491cd 100644 (file)
@@ -60,10 +60,9 @@ handle_surface_commit(pepper_event_listener_t *listener, pepper_object_t *surfac
    shsurf = data;
    PE_CHECK(shsurf);
 
-   if (!shsurf->mapped && shsurf->shell_surface_map)
-     {
-        shsurf->shell_surface_map(shsurf);
-     }
+   if ((shsurf->mapped) &&
+       (!pepper_view_is_mapped(shsurf->view)))
+     pepper_view_map(shsurf->view);
 }
 
 static void