From 0f8ad242fb9c82e542ace1d2595038edf87f7b3d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 20 Jan 2012 08:57:17 +0100 Subject: 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 Reviewed-by: Bradley T. Hughes --- src/plugins/platforms/windows/qwindowscontext.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowscontext.cpp') diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 5e101d1869..4f42f7fa3b 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -747,18 +747,11 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND hwnd, UINT message, WPAR LRESULT result; const QtWindows::WindowsEventType et = windowsEventType(message, wParam); const bool handled = QWindowsContext::instance()->windowsProc(hwnd, message, et, wParam, lParam, &result); - const bool guiEventsQueued = QWindowSystemInterface::windowSystemEventsQueued(); if (QWindowsContext::verboseEvents > 1) if (const char *eventName = QWindowsGuiEventDispatcher::windowsMessageName(message)) - qDebug("EVENT: hwd=%p %s msg=0x%x et=0x%x wp=%d at %d,%d handled=%d gui=%d", + qDebug("EVENT: hwd=%p %s msg=0x%x et=0x%x wp=%d at %d,%d handled=%d", hwnd, eventName, message, et, int(wParam), - GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), handled, guiEventsQueued); - if (guiEventsQueued) { - const QWindowsGuiEventDispatcher::DispatchContext dispatchContext = - QWindowsGuiEventDispatcher::currentDispatchContext(); - if (dispatchContext.first) - QWindowSystemInterface::sendWindowSystemEvents(dispatchContext.first, dispatchContext.second); - } + GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), handled); if (!handled) result = DefWindowProc(hwnd, message, wParam, lParam); return result; -- cgit v1.2.3