summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp7
1 files changed, 6 insertions, 1 deletions
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;