From 2f94b7a991ff9e0138889cb13458d466d295cc59 Mon Sep 17 00:00:00 2001 From: Olivier JG Date: Sun, 30 Apr 2017 10:49:17 -0500 Subject: 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 --- src/plugins/platforms/windows/qwindowscontext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/windows') 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)) { -- cgit v1.2.3