summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-11-16 12:39:13 +0100
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-11-16 12:45:26 +0100
commitb7b567401c42343aed9abac7328472d6ffb37af0 (patch)
tree92a88b8024d615145b85b1df31ac360618d13405 /src/corelib
parentd215ecd857be9eedee03703153ef2509c01b4811 (diff)
Don't sendPostedEvents() twice when calling processEvents() manually
Commit fe0f807e1f4e7510c6d8cddd848bcbc25e358651 could cause sendPostedEvents() to be called twice, which caused regressions in tests/auto/qtimer. Fix this by only calling sendPostedEvents() "manually" if we didn't see a WM_QT_SENDPOSTEDEVENTS message. Reviewed-by: Prasanth Ullattil
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 0518e2457a..b3497b99b3 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -675,11 +675,6 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
bool seenWM_QT_SENDPOSTEDEVENTS = false;
bool needWM_QT_SENDPOSTEDEVENTS = false;
do {
- if (! (flags & QEventLoop::EventLoopExec)) {
- // when called "manually", always send posted events
- QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
- }
-
DWORD waitRet = 0;
HANDLE pHandles[MAXIMUM_WAIT_OBJECTS - 1];
QVarLengthArray<MSG> processedTimers;
@@ -730,7 +725,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
}
}
if (haveMessage) {
- if (msg.message == WM_QT_SENDPOSTEDEVENTS && !(flags & QEventLoop::EventLoopExec)) {
+ if (msg.message == WM_QT_SENDPOSTEDEVENTS) {
if (seenWM_QT_SENDPOSTEDEVENTS) {
needWM_QT_SENDPOSTEDEVENTS = true;
continue;
@@ -785,6 +780,11 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
}
} while (canWait);
+ if (!seenWM_QT_SENDPOSTEDEVENTS && (flags & QEventLoop::EventLoopExec) == 0) {
+ // when called "manually", always send posted events
+ QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
+ }
+
if (needWM_QT_SENDPOSTEDEVENTS)
PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS, 0, 0);