[vlc-devel] [PATCH 2/5] common/win32_fullscreen: added support of multimonitor configurations

Sergey Radionov rsatom at gmail.com
Sun Jan 1 17:25:23 CET 2012


---
 common/win32_fullscreen.cpp |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/common/win32_fullscreen.cpp b/common/win32_fullscreen.cpp
index 27925a6..28ff7ce 100644
--- a/common/win32_fullscreen.cpp
+++ b/common/win32_fullscreen.cpp
@@ -894,9 +894,28 @@ void VLCWindowsManager::StartFullScreen()
             _FSWnd= VLCFullScreenWnd::CreateFSWindow(this);
         }
 
+        RECT FSRect = { 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN) };
+
+        HMONITOR hMonitor = MonitorFromWindow(_hWindowedParentWnd, MONITOR_DEFAULTTONEAREST);
+        MONITORINFO MonInfo;
+        memset(&MonInfo, 0, sizeof(MonInfo));
+        MonInfo.cbSize = sizeof(MonInfo);
+        if( GetMonitorInfo(hMonitor, &MonInfo) ) {
+            FSRect = MonInfo.rcMonitor;
+        }
+
+#ifdef _DEBUG
+        //to simplify debugging in fullscreen mode
+        UINT FSFlags = SWP_NOZORDER;
+#else
+        UINT FSFlags = 0;
+#endif
+
         SetParent(_HolderWnd->getHWND(), _FSWnd->getHWND());
-        SetWindowPos(_FSWnd->getHWND(), HWND_TOPMOST, 0, 0,
-                     GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), 0/** SWP_NOZORDER**/);
+        SetWindowPos(_FSWnd->getHWND(), HWND_TOPMOST,
+                     FSRect.left, FSRect.top,
+                     FSRect.right - FSRect.left, FSRect.bottom - FSRect.top,
+                     FSFlags);
 
         ShowWindow(_FSWnd->getHWND(), SW_SHOW);
         ShowWindow(_hWindowedParentWnd, SW_HIDE);
-- 
1.7.7.1.msysgit.0




More information about the vlc-devel mailing list