[vlc-devel] commit: Win32: go fullscreen on the same screen as the vout window ( Geoffroy Couprie )
git version control
git at videolan.org
Sat Jan 3 12:42:07 CET 2009
vlc | branch: 0.9-bugfix | Geoffroy Couprie <geo.couprie at gmail.com> | Sat Jan 3 01:30:06 2009 +0100| [eb757a4f41108dea877c20c20e01ca992990ead1] | committer: Jean-Baptiste Kempf
Win32: go fullscreen on the same screen as the vout window
(cherry picked from commit b27c02bb5b6632342e394d22c69b8d549f9dae34)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eb757a4f41108dea877c20c20e01ca992990ead1
---
modules/video_output/msw/events.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/modules/video_output/msw/events.c b/modules/video_output/msw/events.c
index b953e1a..f219e8b 100644
--- a/modules/video_output/msw/events.c
+++ b/modules/video_output/msw/events.c
@@ -1191,14 +1191,17 @@ void Win32ToggleFullscreen( vout_thread_t *p_vout )
if( p_vout->p_sys->hparent )
{
/* Retrieve current window position so fullscreen will happen
- * on the right screen */
- POINT point = {0,0};
- RECT rect;
- ClientToScreen( p_vout->p_sys->hwnd, &point );
- GetClientRect( p_vout->p_sys->hwnd, &rect );
- SetWindowPos( hwnd, 0, point.x, point.y,
- rect.right, rect.bottom,
- SWP_NOZORDER|SWP_FRAMECHANGED );
+ *on the right screen */
+ HMONITOR hmon = MonitorFromWindow(p_vout->p_sys->hparent,
+ MONITOR_DEFAULTTONEAREST);
+ MONITORINFO mi = {sizeof(mi)};
+ if (GetMonitorInfo(hmon, &mi))
+ SetWindowPos( hwnd, 0,
+ mi.rcMonitor.left,
+ mi.rcMonitor.top,
+ mi.rcMonitor.right - mi.rcMonitor.left,
+ mi.rcMonitor.bottom - mi.rcMonitor.top,
+ SWP_NOZORDER|SWP_FRAMECHANGED );
}
/* Maximize window */
@@ -1206,6 +1209,7 @@ void Win32ToggleFullscreen( vout_thread_t *p_vout )
if( p_vout->p_sys->hparent )
{
+ /* Hide the previous window */
RECT rect;
GetClientRect( hwnd, &rect );
SetParent( p_vout->p_sys->hwnd, hwnd );
More information about the vlc-devel
mailing list