diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2014-12-11 13:16:56 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2014-12-11 16:10:47 +0100 |
commit | 994bbcf1df83ecd6ed273926128d55088bd7ef5e (patch) | |
tree | 848e6305a4db6ac823925c0b05423d9bbd2f3a19 /src | |
parent | 3740fb41fe122c062408bf49de85a3977b6ae4ed (diff) |
Windows: Fix window geometry when using QWindow::fromWinId().
Take margins into account.
Task-number: QTBUG-43252
Change-Id: I816115d2bbbcee3e8663f42bf07b1a140a049e69
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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; } |