Get orientation via widget to fully sync orientation
authorChanghyup Jwa <ch.jwa@samsung.com>
Fri, 12 Apr 2013 07:34:44 +0000 (16:34 +0900)
committerGerrit Code Review <gerrit2@kim11>
Fri, 12 Apr 2013 08:41:45 +0000 (17:41 +0900)
[Title] Get orientation via widget to fully sync orientation
[Issue#] SE-32463, SE-33848, SE-34116
[Problem] WebApp gets orientation unapplied screen value
[Cause] On launching time, Ecore_X_Window cannot guarantee orientation sync
[Solution] Get orientation via widget

Change-Id: I7d78894d76b5a0845a2a9e48e64ed708d8a33a42

Source/WebCore/platform/efl/PlatformScreenEfl.cpp

index 1a73e5d..97e46e1 100644 (file)
@@ -117,7 +117,9 @@ bool screenIsMonochrome(Widget* widget)
 FloatRect screenRect(Widget* widget)
 {
 #ifdef HAVE_ECORE_X
+#if !ENABLE(ORIENTATION_EVENTS)
     UNUSED_PARAM(widget);
+#endif
     // Fallback to realistic values if the EcoreX call fails
     // and we cannot accurately detect the screen size.
     int width = 800;
@@ -125,6 +127,22 @@ FloatRect screenRect(Widget* widget)
     ecore_x_screen_size_get(ecore_x_default_screen_get(), &width, &height);
 
 #if OS(TIZEN)
+#if ENABLE(ORIENTATION_EVENTS)
+    // Getting orientation via Ecore_X_Window cannot be fully synced
+    // So, we use Frame::orientation() if we have widget here
+    if (widget) {
+        FrameView* frameView = static_cast<FrameView*>(widget);
+        Frame* frame = frameView->frame();
+        int orientation = frame ? frame->orientation() : 0;
+        if (orientation == 90 || orientation == 270) {
+            int temp = width;
+            width = height;
+            height = temp;
+        }
+        return FloatRect(0, 0, width, height);
+    }
+#endif
+
     int count = 0;
     unsigned char *prop_data = NULL;
     Ecore_X_Window xWindow = ecore_x_window_root_first_get();