aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Berres <armin.berres@basyskom.de>2010-06-08 11:21:35 +0200
committerTomas Junnonen <tomas.junnonen@nokia.com>2010-06-14 12:37:22 +0300
commit67c2e32d92667e5fe2269e0e4c7200401b607ce5 (patch)
tree2a071bd31819b9c12aca32c1c810b91ce4247b88
parent96028ecb867d57752bd9bdee33bf2fc52d346dc1 (diff)
Changes: Do not animate rotation when application is minimized
RevBy: Tomas Junnonen Details: Applications visible in the switcher should rotate immediately and not animate themselves.
-rw-r--r--src/corelib/scene/mscenemanager.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/corelib/scene/mscenemanager.cpp b/src/corelib/scene/mscenemanager.cpp
index 5338701c..0940d049 100644
--- a/src/corelib/scene/mscenemanager.cpp
+++ b/src/corelib/scene/mscenemanager.cpp
@@ -1562,10 +1562,29 @@ void MSceneManager::setOrientationAngle(M::OrientationAngle angle,
}
}
} else {
- if (mode == AnimatedTransition)
- d->rotateToAngle(angle);
- else
+ if (mode == AnimatedTransition) {
+ bool managesVisibleWindow = false;
+
+ // Only animate the rotation if it is actually visible to the user
+ QList<QGraphicsView *> viewsList = scene()->views();
+ for (int i = 0; i < viewsList.count(); ++i) {
+ MWindow *window = qobject_cast<MWindow *>(viewsList[i]);
+
+ if (window && window->isOnDisplay()) {
+ if (window->windowState() != Qt::WindowMinimized) {
+ managesVisibleWindow = true;
+ }
+ break;
+ }
+ }
+ if (managesVisibleWindow) {
+ d->rotateToAngle(angle);
+ } else {
+ d->setOrientationAngleWithoutAnimation(angle);
+ }
+ } else {
d->setOrientationAngleWithoutAnimation(angle);
+ }
}
}