mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
fix FramelessMainWindow
This commit is contained in:
parent
79993814a8
commit
2b5076584d
@ -144,20 +144,20 @@ bool FramelessMainWindowWin::nativeEvent(const QByteArray &p_eventType, void *p_
|
||||
RECT frame = {0, 0, 0, 0};
|
||||
::AdjustWindowRectEx(&frame, WS_OVERLAPPEDWINDOW, false, 0);
|
||||
const int dpiScale = devicePixelRatio();
|
||||
m_maximizedMargins.setLeft(qAbs(frame.left) / dpiScale);
|
||||
// Use bottom as top.
|
||||
m_maximizedMargins.setTop(qAbs(frame.bottom) / dpiScale);
|
||||
m_maximizedMargins.setRight(frame.right / dpiScale);
|
||||
m_maximizedMargins.setBottom(frame.bottom / dpiScale);
|
||||
QMargins newMargins(qAbs(frame.left) / dpiScale,
|
||||
qAbs(frame.bottom) / dpiScale,
|
||||
frame.right / dpiScale,
|
||||
frame.bottom / dpiScale);
|
||||
if (newMargins != m_maximizedMargins) {
|
||||
m_maximizedMargins = newMargins;
|
||||
updateMargins();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
if (msg->wParam == PBT_APMRESUMESUSPEND) {
|
||||
// Show after resuming from sleep.
|
||||
showNormal();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user