Title: [130764] trunk/Source/WebKit2
Revision
130764
Author
[email protected]
Date
2012-10-09 08:03:43 -0700 (Tue, 09 Oct 2012)

Log Message

[EFL][WK2] Inform the PageProxy about visibility changes when the view is shown/hidden.
https://bugs.webkit.org/show_bug.cgi?id=98757

Reviewed by Kenneth Rohde Christiansen.

SVN r130720 exposed a bug in our code: the PageProxy is not
notified when one calls evas_object_show() or evas_object_hide()
on the view, so the visibility it has when the WebPageProxy is
constructed remained set forever.

This made the ewk_context_vibration_client_callbacks_set unit test
start running forever, because WebPageProxy's constructor now sets
the page's visibility to hidden by the default for us, since it is
called from within ewk_view_smart_add() and before
evas_object_show().

We now listen to the EVAS_CALLBACK_SHOW and EVAS_CALLBACK_HIDE
callbacks and update the WebPageProxy accordingly. Note that we
could not do this from the smart_show and smart_hide functions we
already had, since they are called before the object's actual
visibility is updated.

* UIProcess/API/efl/ewk_view.cpp:
(_ewk_view_on_show):
(_ewk_view_on_hide):
(_ewk_view_smart_add):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (130763 => 130764)


--- trunk/Source/WebKit2/ChangeLog	2012-10-09 15:00:42 UTC (rev 130763)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-09 15:03:43 UTC (rev 130764)
@@ -1,3 +1,32 @@
+2012-10-09  Raphael Kubo da Costa  <[email protected]>
+
+        [EFL][WK2] Inform the PageProxy about visibility changes when the view is shown/hidden.
+        https://bugs.webkit.org/show_bug.cgi?id=98757
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        SVN r130720 exposed a bug in our code: the PageProxy is not
+        notified when one calls evas_object_show() or evas_object_hide()
+        on the view, so the visibility it has when the WebPageProxy is
+        constructed remained set forever.
+
+        This made the ewk_context_vibration_client_callbacks_set unit test
+        start running forever, because WebPageProxy's constructor now sets
+        the page's visibility to hidden by the default for us, since it is
+        called from within ewk_view_smart_add() and before
+        evas_object_show().
+
+        We now listen to the EVAS_CALLBACK_SHOW and EVAS_CALLBACK_HIDE
+        callbacks and update the WebPageProxy accordingly. Note that we
+        could not do this from the smart_show and smart_hide functions we
+        already had, since they are called before the object's actual
+        visibility is updated.
+
+        * UIProcess/API/efl/ewk_view.cpp:
+        (_ewk_view_on_show):
+        (_ewk_view_on_hide):
+        (_ewk_view_smart_add):
+
 2012-10-09  Simon Pena  <[email protected]>
 
         [GTK] Add support for running _javascript_ from GResources

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (130763 => 130764)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-10-09 15:00:42 UTC (rev 130763)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-10-09 15:03:43 UTC (rev 130764)
@@ -362,6 +362,24 @@
     smartData->api->key_up(smartData, upEvent);
 }
 
+static void _ewk_view_on_show(void* data, Evas*, Evas_Object*, void* /*eventInfo*/)
+{
+    Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
+    priv->pageProxy->viewStateDidChange(WebPageProxy::ViewIsVisible);
+}
+
+static void _ewk_view_on_hide(void* data, Evas*, Evas_Object*, void* /*eventInfo*/)
+{
+    Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
+
+    // This call may look wrong, but we really need to pass ViewIsVisible here.
+    // viewStateDidChange() itself is responsible for actually setting the visibility to Visible or Hidden
+    // depending on what WebPageProxy::isViewVisible() returns, this simply triggers the process.
+    priv->pageProxy->viewStateDidChange(WebPageProxy::ViewIsVisible);
+}
+
 #if ENABLE(TOUCH_EVENTS)
 static inline void _ewk_view_feed_touch_event_using_touch_point_list_of_evas(Evas_Object* ewkView, Ewk_Touch_Event_Type type)
 {
@@ -481,6 +499,8 @@
     CONNECT(EVAS_CALLBACK_MOUSE_WHEEL, _ewk_view_on_mouse_wheel);
     CONNECT(EVAS_CALLBACK_KEY_DOWN, _ewk_view_on_key_down);
     CONNECT(EVAS_CALLBACK_KEY_UP, _ewk_view_on_key_up);
+    CONNECT(EVAS_CALLBACK_SHOW, _ewk_view_on_show);
+    CONNECT(EVAS_CALLBACK_HIDE, _ewk_view_on_hide);
 #undef CONNECT
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to