From 2df293267ee3cdc111191dad2f3551d9fa05c88d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 27 Nov 2014 12:02:41 +0100 Subject: Windows: Skip calculating margins for Qt::FramelessWindowHint. Always skip calculating style-dependent margins for windows claimed to be frameless by Qt. This allows users to remove the margins by handling WM_NCCALCSIZE with WS_THICKFRAME set to ensure Areo snap still works. Task-number: QTBUG-40578 Change-Id: Ice7771df8fbf59b370568219d10c12ce04e99628 Reviewed-by: Joerg Bornemann Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowswindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 48ffd84f98..5768800947 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1831,7 +1831,12 @@ QMargins QWindowsWindow::frameMarginsDp() const // event sequences, introduce a dirty flag mechanism to be able // to cache results. if (testFlag(FrameDirty)) { - m_data.frame = QWindowsGeometryHint::frame(style(), exStyle()); + // Always skip calculating style-dependent margins for windows claimed to be frameless. + // This allows users to remove the margins by handling WM_NCCALCSIZE with WS_THICKFRAME set + // to ensure Areo snap still works (QTBUG-40578). + m_data.frame = window()->flags() & Qt::FramelessWindowHint + ? QMargins(0, 0, 0, 0) + : QWindowsGeometryHint::frame(style(), exStyle()); clearFlag(FrameDirty); } return m_data.frame + m_data.customMargins; -- cgit v1.2.3