fix the issue that web app can't rotate
authorShao Changbin <changbin.shao@intel.com>
Thu, 31 Jan 2013 09:21:01 +0000 (04:21 -0500)
committerShao Changbin <changbin.shao@intel.com>
Fri, 1 Feb 2013 04:42:11 +0000 (23:42 -0500)
[Issue#]       TDIS-1063
[Bug]          Web app is not able to rotate when rotation sensor is enabled.
[Cause]        screen rotation callback is not registered in wrt
[Solution]     set orientation callback for ewk view

Change-Id: I521e266a625c7b4bec2d8a1bc93db37f3ae5e9b2

src/view/webkit/view_logic.cpp

index caa04f1..b9e11ff 100755 (executable)
@@ -569,6 +569,11 @@ void ViewLogic::ewkClientInit(Evas_Object *wkView) {
             it->second,
             this);
     }
+    // EWK Orientation Callback
+    ewk_view_orientation_lock_callback_set(
+        wkView,
+        orientationLockCallback,
+        this);
 }
 
 void ViewLogic::ewkClientDeinit(Evas_Object *wkView) {
@@ -581,6 +586,10 @@ void ViewLogic::ewkClientDeinit(Evas_Object *wkView) {
             it->first.c_str(),
             it->second);
     }
+    ewk_view_orientation_lock_callback_set(
+        wkView,
+        NULL,
+        NULL);
 }
 
 bool ViewLogic::createEwkView(Evas* canvas)