summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier JG <olivier.de.gaalon@kdab.com>2017-04-30 10:49:17 -0500
committerOlivier de Gaalon <olivier.de.gaalon@kdab.com>2017-05-02 12:54:38 +0000
commit2f94b7a991ff9e0138889cb13458d466d295cc59 (patch)
tree6029f5f8406d91541f9e6fba14276e8913f2e08f
parentd160809015e49d6435dc876135b88f17af4f8008 (diff)
Windows QPA: Find window before invoking native filters
When handling WM_NCCALCSIZE in a global filter, the associated platform window needs to be assigned to platformWindowPtr so that its frame margins can be updated on return. See also 3035400f36731c400adb9204b94e9afe346a71b7, which introduced the platformWindowPtr out parameter for this purpose. [ChangeLog][Platform Specific Changes][Windows] Fixed frameMargins for WM_NCCALCSIZE when handled inside with QAbstractNativeEventFilter. Change-Id: I7827b81d30a5c80dad591206a88712169dea0108 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index ff4ab1accb..eb62bd2e1f 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -855,6 +855,9 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
GetCursorPos(&msg.pt);
}
+ QWindowsWindow *platformWindow = findPlatformWindow(hwnd);
+ *platformWindowPtr = platformWindow;
+
// Run the native event filters.
long filterResult = 0;
QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance();
@@ -863,8 +866,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
return true;
}
- QWindowsWindow *platformWindow = findPlatformWindow(hwnd);
- *platformWindowPtr = platformWindow;
if (platformWindow) {
filterResult = 0;
if (QWindowSystemInterface::handleNativeEvent(platformWindow->window(), d->m_eventType, &msg, &filterResult)) {