summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-09-03 11:41:19 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-09-08 11:01:27 (GMT)
commit9a90fcca3e9a9a49cee228054017ff7d15645082 (patch)
treef507b06a68d4609c30c67310230441da578688a4 /src
parent2075cb4fc05dc077db1bb9437dd0fcf75605fe9c (diff)
downloadQt-9a90fcca3e9a9a49cee228054017ff7d15645082.zip
Qt-9a90fcca3e9a9a49cee228054017ff7d15645082.tar.gz
Qt-9a90fcca3e9a9a49cee228054017ff7d15645082.tar.bz2
Animations of redocking widgets are broken
The problem is that when starting an animation, we delay it by starting a 0-timer. That doesn't work on windows while dragging a native window. Task-number: 260772 Reviewed-by: prasanth
Diffstat (limited to 'src')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index e1b8509..31f0841 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -157,6 +157,19 @@
#define DEFAULT_TIMER_INTERVAL 16
+#ifdef Q_WS_WIN
+ /// Fix for Qt 4.7
+ //on windows if you're currently dragging a widget an inner eventloop was started by the system
+ //to make sure that this timer is getting fired, we need to make sure to use the system timers
+ //that will send a WM_TIMER event. We do that by settings the timer interval to 11
+ //It is 11 because QEventDispatcherWin32Private::registerTimer specifically checks if the interval
+ //is greater than 10 to determine if it should use a system timer (or the multimedia timer).
+#define STARTSTOP_TIMER_DELAY 11
+#else
+#define STARTSTOP_TIMER_DELAY 0
+#endif
+
+
QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer)
@@ -217,7 +230,7 @@ void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation)
if (animations.contains(animation) || animationsToStart.contains(animation))
return;
animationsToStart << animation;
- startStopAnimationTimer.start(0, this); // we delay the check if we should start/stop the global timer
+ startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this); // we delay the check if we should start/stop the global timer
}
void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation)
@@ -233,7 +246,7 @@ void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation)
} else {
animationsToStart.removeOne(animation);
}
- startStopAnimationTimer.start(0, this); // we delay the check if we should start/stop the global timer
+ startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this); // we delay the check if we should start/stop the global timer
}