Skip to content

Commit e7f6e05

Browse files
authored
Merge pull request #315 from tripplet/fix_windowpos
Fix window position restore on multi monitor setup
2 parents 2037f89 + 10bb13b commit e7f6e05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DebugView++/MainFrame.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,8 @@ bool CMainFrame::LoadSettings()
673673
reg.Create(HKEY_CURRENT_USER, RegistryPath);
674674
if (reg.QueryDWORDValue(L"X", x) == ERROR_SUCCESS && static_cast<int>(x) >= GetSystemMetrics(SM_XVIRTUALSCREEN) &&
675675
reg.QueryDWORDValue(L"Y", y) == ERROR_SUCCESS && static_cast<int>(y) >= GetSystemMetrics(SM_YVIRTUALSCREEN) &&
676-
reg.QueryDWORDValue(L"Width", cx) == ERROR_SUCCESS && static_cast<int>(x + cx) <= GetSystemMetrics(SM_CXVIRTUALSCREEN) &&
677-
reg.QueryDWORDValue(L"Height", cy) == ERROR_SUCCESS && static_cast<int>(y + cy) <= GetSystemMetrics(SM_CYVIRTUALSCREEN))
676+
reg.QueryDWORDValue(L"Width", cx) == ERROR_SUCCESS && static_cast<int>(x + cx) <= GetSystemMetrics(SM_XVIRTUALSCREEN) + GetSystemMetrics(SM_CXVIRTUALSCREEN) &&
677+
reg.QueryDWORDValue(L"Height", cy) == ERROR_SUCCESS && static_cast<int>(y + cy) <= GetSystemMetrics(SM_YVIRTUALSCREEN) + GetSystemMetrics(SM_CYVIRTUALSCREEN))
678678
SetWindowPos(0, x, y, cx, cy, SWP_NOZORDER);
679679

680680
m_linkViews = Win32::RegGetDWORDValue(reg, L"LinkViews", 0) != 0;

0 commit comments

Comments
 (0)