Skip to content

Commit

Permalink
fix FramelessMainWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
tamlok committed Oct 24, 2021
1 parent 7999381 commit 2b50765
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/widgets/framelessmainwindow/framelessmainwindowwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 2b50765

Please sign in to comment.