From 3b587d022a6236316015b73efcce7380692723a8 Mon Sep 17 00:00:00 2001 From: Marc Britten Date: Tue, 10 Mar 2015 22:05:29 -0500 Subject: [PATCH] Updated Freeze to be multi monitor friendly --- src/win32/freeze.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/win32/freeze.cpp b/src/win32/freeze.cpp index af278a8c..129df94c 100644 --- a/src/win32/freeze.cpp +++ b/src/win32/freeze.cpp @@ -108,8 +108,16 @@ void ThawWindowPosF(HWND hwnd, const char *subKey, const char *name) if(v) ShowWindow(hwnd, SW_MAXIMIZE); - RECT dr; - GetWindowRect(GetDesktopWindow(), &dr); + + HMONITOR hMonitor; + MONITORINFO mi; + RECT dr; + + hMonitor = MonitorFromRect(&r, MONITOR_DEFAULTTONEAREST); + + mi.cbSize = sizeof(mi); + GetMonitorInfo(hMonitor, &mi); + dr = mi.rcMonitor; // If it somehow ended up off-screen, then put it back. Clamp(&(r.left), dr.left, dr.right);