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>
This commit is contained in:
parent
30772c7270
commit
2df293267e
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user