diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2010-10-20 10:09:52 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2010-10-20 11:56:11 (GMT) |
commit | a7d4a808b4ee3e22042bd29e62ced4670c28ea89 (patch) | |
tree | 4554505ea12134f37284d1eea6ab579fe7450d4f /src/corelib | |
parent | 98b931a841f284051a2e22de412701bd2c4f4a76 (diff) | |
download | Qt-a7d4a808b4ee3e22042bd29e62ced4670c28ea89.zip Qt-a7d4a808b4ee3e22042bd29e62ced4670c28ea89.tar.gz Qt-a7d4a808b4ee3e22042bd29e62ced4670c28ea89.tar.bz2 |
Don't allow posted events to starve native messages.
This reverts commit 9215506e6a057d8aef7415c2921214e1ba1c760d, which
caused the above behavior. The intention of this commit was to prevent
native messages from starving posted events, but as shown by the
example, it is possible for posted events to then starve native messages
(which results in very bad behavior on Windows if the user is moving or
resizing a window).
Unfortunately, my attempts to construct an autotest for this have
failed, as I've not found a way to generate the right kinds of native
messages from code.
Task-number: QTBUG-14021
Reviewed-by: prasanth
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_win.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 153ccdf..a719e72 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -354,9 +354,6 @@ public: // for controlling when to send posted events QAtomicInt serialNumber; int lastSerialNumber; -#ifndef Q_OS_WINCE - int lastMessageTime; -#endif QAtomicInt wakeUps; // timers @@ -381,11 +378,7 @@ public: QEventDispatcherWin32Private::QEventDispatcherWin32Private() : threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0), getMessageHook(0), - serialNumber(0), lastSerialNumber(0), -#ifndef Q_OS_WINCE - lastMessageTime(0), -#endif - wakeUps(0) + serialNumber(0), lastSerialNumber(0), wakeUps(0) { resolveTimerAPI(); } @@ -500,9 +493,6 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA int localSerialNumber = d->serialNumber; if (localSerialNumber != d->lastSerialNumber) { d->lastSerialNumber = localSerialNumber; -#ifndef Q_OS_WINCE - d->lastMessageTime = GetMessageTime(); -#endif QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); } return 0; @@ -521,11 +511,7 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp) int localSerialNumber = d->serialNumber; MSG unused; if ((HIWORD(GetQueueStatus(QS_INPUT | QS_RAWINPUT)) == 0 - && PeekMessage(&unused, 0, WM_TIMER, WM_TIMER, PM_NOREMOVE) == 0) -#ifndef Q_OS_WINCE - || GetMessageTime() - d->lastMessageTime >= 10 -#endif - ) { + && PeekMessage(&unused, 0, WM_TIMER, WM_TIMER, PM_NOREMOVE) == 0)) { // no more input or timer events in the message queue or more than 10ms has elapsed since // we send posted events, we can allow posted events to be sent now (void) d->wakeUps.fetchAndStoreRelease(0); |