diff options
author | Marcin Miklas <marcin.miklas@teleca.com> | 2010-12-23 15:14:46 +0100 |
---|---|---|
committer | Dominik Kapusta <dominik.kapusta@teleca.com> | 2010-12-28 09:48:06 +0100 |
commit | fa802488a36608d32f89239d4188f663edad8909 (patch) | |
tree | 342b58b1478e45ef5b9558b749bea1ad74801641 | |
parent | 50f483f58552e9c5552934d588b77e52019a532c (diff) |
Fixes: NB#212180
RevBy: Dominik
Details: Before starting following current app window orientation, we check
if current app window orientation can be retrieved without error.
If covers the case when mcompositor isn't running.
-rw-r--r-- | src/corelib/events/morientationtracker.cpp | 6 | ||||
-rw-r--r-- | src/corelib/events/morientationtracker_p.h | 2 | ||||
-rw-r--r-- | src/corelib/widgets/mwindow.cpp | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/corelib/events/morientationtracker.cpp b/src/corelib/events/morientationtracker.cpp index eddc937d..ade3fe2a 100644 --- a/src/corelib/events/morientationtracker.cpp +++ b/src/corelib/events/morientationtracker.cpp @@ -445,7 +445,7 @@ WId MOrientationTrackerPrivate::fetchWIdCurrentAppWindow() return currentWindowId; } -M::OrientationAngle MOrientationTrackerPrivate::fetchCurrentAppWindowOrientationAngle() +M::OrientationAngle MOrientationTrackerPrivate::fetchCurrentAppWindowOrientationAngle(int* error) { M::OrientationAngle angle = M::Angle0; Atom actualType = 0; @@ -473,6 +473,10 @@ M::OrientationAngle MOrientationTrackerPrivate::fetchCurrentAppWindowOrientation if (status == Success) XFree(data.asUChar); + + if (error) + *error = status; + return angle; } diff --git a/src/corelib/events/morientationtracker_p.h b/src/corelib/events/morientationtracker_p.h index 1570928c..da44c8f6 100644 --- a/src/corelib/events/morientationtracker_p.h +++ b/src/corelib/events/morientationtracker_p.h @@ -70,7 +70,7 @@ public: void handleCurrentAppWindowOrientationAngleChange(); void handleCurrentAppWindowChange(); WId fetchWIdCurrentAppWindow(); - M::OrientationAngle fetchCurrentAppWindowOrientationAngle(); + M::OrientationAngle fetchCurrentAppWindowOrientationAngle(int* error = NULL); WId widCurrentAppWindow; bool currentAppWindowHadXPropertyChangeMask; //windows from this list follow _MEEGOTOUCH_CURRENT_APP_WINDOW (set by meego window manager). diff --git a/src/corelib/widgets/mwindow.cpp b/src/corelib/widgets/mwindow.cpp index 19d98339..f1364e17 100644 --- a/src/corelib/widgets/mwindow.cpp +++ b/src/corelib/widgets/mwindow.cpp @@ -1407,8 +1407,11 @@ bool MWindow::event(QEvent *event) else if (event->type() == QEvent::DynamicPropertyChange) { QDynamicPropertyChangeEvent* dynamicEvent = static_cast<QDynamicPropertyChangeEvent*>(event); if (dynamicEvent->propertyName() == FollowsCurrentApplicationWindowOrientationPropertyName) { + int error = 0; + MOrientationTracker::instance()->d_func()->fetchCurrentAppWindowOrientationAngle(&error); + //property was set, does not matter what value - if (property(FollowsCurrentApplicationWindowOrientationPropertyName).isValid()) { + if (property(FollowsCurrentApplicationWindowOrientationPropertyName).isValid() && error == Success) { mDebug("MWindow") << "window follows current app window orientation"; MOrientationTracker::instance()->d_func()->startFollowingCurrentAppWindow(this); } |