Run per-QWindow native event filter for all events.
Task-number: QTBUG-27101 Change-Id: I064f91e250d68223da3b81d605e522c8b78535f5 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
This commit is contained in:
parent
924aeb2787
commit
dcc2e84fd0
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user