From 994bbcf1df83ecd6ed273926128d55088bd7ef5e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 11 Dec 2014 13:16:56 +0100 Subject: Windows: Fix window geometry when using QWindow::fromWinId(). Take margins into account. Task-number: QTBUG-43252 Change-Id: I816115d2bbbcee3e8663f42bf07b1a140a049e69 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/windows') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 5768800947..05ed6aed53 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -559,10 +559,11 @@ QWindowsWindowData Q_ASSERT(result.hwnd); const LONG_PTR style = GetWindowLongPtr(result.hwnd, GWL_STYLE); const LONG_PTR exStyle = GetWindowLongPtr(result.hwnd, GWL_EXSTYLE); - result.geometry = frameGeometry(result.hwnd, !GetParent(result.hwnd)); - result.frame = QWindowsGeometryHint::frame(style, exStyle); result.embedded = false; - qCDebug(lcQpaWindows) << "Foreign window: " << w << result.hwnd << result.geometry << result.frame; + result.frame = QWindowsGeometryHint::frame(style, exStyle); + result.geometry = frameGeometry(result.hwnd, !GetParent(result.hwnd)) + .marginsRemoved(result.frame); + qCDebug(lcQpaWindows) << "Foreign window: " << w << result.hwnd << result.geometry; return result; } -- cgit v1.2.3