summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-23 16:47:01 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-24 16:06:50 +0000
commit95a08a711e18c7d994085dff6c1d4df065fb273e (patch)
treec316de3996948b3268d53b00e96b763346bf34e7 /src/plugins/platforms/windows/qwindowswindow.cpp
parenta966991b3af18d57182e5dc5a3ed4985d114b56d (diff)
Windows QPA: Suppress bogus resize events when using native menus
Account for the (not yet created) native menu height when handling the initial resize message. Complements 7849aa6e96aa923fca5523afc8cf88edcc0bcf90. Task-number: QTBUG-65917 Task-number: QTBUG-55967 Change-Id: I65c75d796634ecf1a90a72fef8ff3e6e89de11c4 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 1d81fa9cd5..995b1a2582 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1027,8 +1027,10 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w,
const QMargins effectiveMargins = margins + customMargins;
frameWidth = effectiveMargins.left() + geometry.width() + effectiveMargins.right();
frameHeight = effectiveMargins.top() + geometry.height() + effectiveMargins.bottom();
- if (QWindowsMenuBar::menuBarOf(w) != nullptr)
- frameHeight += GetSystemMetrics(SM_CYMENU);
+ if (QWindowsMenuBar::menuBarOf(w) != nullptr) {
+ menuHeight = GetSystemMetrics(SM_CYMENU);
+ frameHeight += menuHeight;
+ }
const bool isDefaultPosition = !frameX && !frameY && w->isTopLevel();
if (!QWindowsGeometryHint::positionIncludesFrame(w) && !isDefaultPosition) {
frameX -= effectiveMargins.left();