From: Friedemann Kleint Date: Thu, 4 Oct 2012 10:30:46 +0000 (+0200) Subject: Run per-QWindow native event filter for all events. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dcc2e84fd0cdc90d633d2e5992ab1fc03e2aa861;p=profile%2Fivi%2Fqtbase.git Run per-QWindow native event filter for all events. Task-number: QTBUG-27101 Change-Id: I064f91e250d68223da3b81d605e522c8b78535f5 Reviewed-by: Miikka Heikkinen --- diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index a9102ff..bd69bf8 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: