From 67c2e32d92667e5fe2269e0e4c7200401b607ce5 Mon Sep 17 00:00:00 2001 From: Armin Berres Date: Tue, 8 Jun 2010 11:21:35 +0200 Subject: 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. --- src/corelib/scene/mscenemanager.cpp | 25 ++++++++++++++++++++++--- 1 file 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 viewsList = scene()->views(); + for (int i = 0; i < viewsList.count(); ++i) { + MWindow *window = qobject_cast(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); + } } } -- cgit v1.2.3