Merge branch 'new_osg' of http://brigecode.icu:16623/PM/DYTSrouce into new_osg
This commit is contained in:
commit
8fee163887
@ -162,24 +162,22 @@ bool FramelessDelegateWin::nativeEvent(const QByteArray & eventType, void* messa
|
||||
if (monitor && GetMonitorInfo(monitor, &mi)) {
|
||||
const RECT& work = mi.rcWork;
|
||||
const RECT& rcMon = mi.rcMonitor;
|
||||
const int frameX = GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);
|
||||
const int frameY = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);
|
||||
// Use monitor work area directly to avoid off-screen placement on multi-monitor setups
|
||||
mmi->ptMaxPosition.x = 0;
|
||||
mmi->ptMaxPosition.y = 0;
|
||||
mmi->ptMaxSize.x = (work.right - work.left);
|
||||
mmi->ptMaxSize.y = (work.bottom - work.top);
|
||||
|
||||
mmi->ptMaxPosition.x = work.left - frameX;
|
||||
mmi->ptMaxPosition.y = work.top - frameY;
|
||||
mmi->ptMaxSize.x = (work.right - work.left) + frameX * 2;
|
||||
mmi->ptMaxSize.y = (work.bottom - work.top) + frameY * 2;
|
||||
|
||||
mmi->ptMaxTrackSize.x = (rcMon.right - rcMon.left) + frameX * 2;
|
||||
mmi->ptMaxTrackSize.y = (rcMon.bottom - rcMon.top) + frameY * 2;
|
||||
mmi->ptMaxTrackSize.x = (rcMon.right - rcMon.left);
|
||||
mmi->ptMaxTrackSize.y = (rcMon.bottom - rcMon.top);
|
||||
|
||||
const QSize minSize = mainWidget_->minimumSize();
|
||||
const double dpr = mainWidget_->devicePixelRatioF();
|
||||
const int minWpx = static_cast<int>(std::round(minSize.width() * dpr));
|
||||
const int minHpx = static_cast<int>(std::round(minSize.height() * dpr));
|
||||
// Guard against zero/negative values
|
||||
const int clampedMinW = std::max(1, minWpx) + frameX * 2;
|
||||
const int clampedMinH = std::max(1, minHpx) + frameY * 2;
|
||||
const int clampedMinW = std::max(1, minWpx);
|
||||
const int clampedMinH = std::max(1, minHpx);
|
||||
mmi->ptMinTrackSize.x = clampedMinW;
|
||||
mmi->ptMinTrackSize.y = clampedMinH;
|
||||
}
|
||||
@ -258,6 +256,7 @@ void FramelessDelegateWin::OnClose() {
|
||||
|
||||
void FramelessDelegateWin::OnScreenChangeInternaal() {
|
||||
if (mainWidget_->internalWinId()) {
|
||||
CheckMonitorChanged();
|
||||
SetWindowPos(reinterpret_cast<HWND>(mainWidget_->winId()), nullptr, 0, 0, 0, 0,
|
||||
SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user