diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2014-11-27 12:02:41 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2014-12-05 06:10:01 +0100 |
commit | 2df293267ee3cdc111191dad2f3551d9fa05c88d (patch) | |
tree | f66fd241fe5b7cc69d5845366196c735549150fc /src | |
parent | 30772c7270aeae784bebe20fe68fad93ea332fb0 (diff) |
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 <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 7 |
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; |