diff options
-rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index a9102ff920..bd69bf8b6a 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -706,13 +706,23 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, msg.pt.x = GET_X_LPARAM(lParam); msg.pt.y = GET_Y_LPARAM(lParam); + // Run the native event filters. long filterResult = 0; QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance(); if (dispatcher && dispatcher->filterNativeEvent(d->m_eventType, &msg, &filterResult)) { *result = LRESULT(filterResult); return true; } - // Events without an associated QWindow or events we are not interested in. + + QWindowsWindow *platformWindow = findPlatformWindow(hwnd); + if (platformWindow) { + filterResult = 0; + if (QWindowSystemInterface::handleNativeEvent(platformWindow->window(), d->m_eventType, &msg, &filterResult)) { + *result = LRESULT(filterResult); + return true; + } + } + switch (et) { case QtWindows::InputMethodStartCompositionEvent: return QWindowsInputContext::instance()->startComposition(hwnd); @@ -743,7 +753,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, break; } - QWindowsWindow *platformWindow = findPlatformWindow(hwnd); // Before CreateWindowEx() returns, some events are sent, // for example WM_GETMINMAXINFO asking for size constraints for top levels. // Pass on to current creation context @@ -776,12 +785,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, return false; } - filterResult = 0; - if (QWindowSystemInterface::handleNativeEvent(platformWindow->window(), d->m_eventType, &msg, &filterResult)) { - *result = LRESULT(filterResult); - return true; - } - switch (et) { case QtWindows::KeyDownEvent: case QtWindows::KeyEvent: |