diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-01-20 08:57:17 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-20 14:17:41 +0100 |
commit | 0f8ad242fb9c82e542ace1d2595038edf87f7b3d (patch) | |
tree | 3506648121a2d62408829dfad37c8ffa0e1a570c /src/corelib/kernel/qeventdispatcher_win.cpp | |
parent | c274ea7cf5e11ade0a5812e3080baa671d012524 (diff) |
Add a virtual sendPostedEvents() to QEventDispatcherWin32.
Reimplement this in QWindowGuiEventDispatcher to send both Qt posted events and
queued QPA window system events. We need to do this at a well defined place,
instead of sending events outside of the eventloop from the Windows proc.
This fixes various hangs for example in tst_qinputdialog, which used a 0-timer
to close a dialog.
Change-Id: I64e0b8f1209fb434059a7fa667ed585902c19db4
Initial-patch-by: bhughes <bradley.hughes@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_win.cpp')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_win.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 3ade11ca60..3ad61fee7c 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -408,7 +408,7 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA const int localSerialNumber = d->serialNumber.load(); if (localSerialNumber != d->lastSerialNumber) { d->lastSerialNumber = localSerialNumber; - QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); + q->sendPostedEvents(); } return 0; } else if (message == WM_TIMER) { @@ -761,7 +761,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) if (!seenWM_QT_SENDPOSTEDEVENTS && (flags & QEventLoop::EventLoopExec) == 0) { // when called "manually", always send posted events - QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); + sendPostedEvents(); } if (needWM_QT_SENDPOSTEDEVENTS) @@ -1076,4 +1076,10 @@ bool QEventDispatcherWin32::event(QEvent *e) return QAbstractEventDispatcher::event(e); } +void QEventDispatcherWin32::sendPostedEvents() +{ + Q_D(QEventDispatcherWin32); + QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); +} + QT_END_NAMESPACE |