Commit eb757a4f authored by Geoffroy Couprie's avatar Geoffroy Couprie Committed by Jean-Baptiste Kempf

Win32: go fullscreen on the same screen as the vout window

(cherry picked from commit b27c02bb)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 34e429ee
...@@ -1191,14 +1191,17 @@ void Win32ToggleFullscreen( vout_thread_t *p_vout ) ...@@ -1191,14 +1191,17 @@ void Win32ToggleFullscreen( vout_thread_t *p_vout )
if( p_vout->p_sys->hparent ) if( p_vout->p_sys->hparent )
{ {
/* Retrieve current window position so fullscreen will happen /* Retrieve current window position so fullscreen will happen
* on the right screen */ *on the right screen */
POINT point = {0,0}; HMONITOR hmon = MonitorFromWindow(p_vout->p_sys->hparent,
RECT rect; MONITOR_DEFAULTTONEAREST);
ClientToScreen( p_vout->p_sys->hwnd, &point ); MONITORINFO mi = {sizeof(mi)};
GetClientRect( p_vout->p_sys->hwnd, &rect ); if (GetMonitorInfo(hmon, &mi))
SetWindowPos( hwnd, 0, point.x, point.y, SetWindowPos( hwnd, 0,
rect.right, rect.bottom, mi.rcMonitor.left,
SWP_NOZORDER|SWP_FRAMECHANGED ); mi.rcMonitor.top,
mi.rcMonitor.right - mi.rcMonitor.left,
mi.rcMonitor.bottom - mi.rcMonitor.top,
SWP_NOZORDER|SWP_FRAMECHANGED );
} }
/* Maximize window */ /* Maximize window */
...@@ -1206,6 +1209,7 @@ void Win32ToggleFullscreen( vout_thread_t *p_vout ) ...@@ -1206,6 +1209,7 @@ void Win32ToggleFullscreen( vout_thread_t *p_vout )
if( p_vout->p_sys->hparent ) if( p_vout->p_sys->hparent )
{ {
/* Hide the previous window */
RECT rect; RECT rect;
GetClientRect( hwnd, &rect ); GetClientRect( hwnd, &rect );
SetParent( p_vout->p_sys->hwnd, hwnd ); SetParent( p_vout->p_sys->hwnd, hwnd );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment