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>
bb10
Friedemann Kleint 2014-12-11 13:16:56 +01:00
parent 3740fb41fe
commit 994bbcf1df
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}