changeset 22389:8ab800c12f85

simplify and modify fullscreen switching to avoid improper aspects
author vayne
date Fri, 02 Mar 2007 00:33:32 +0000
parents c7b920227b00
children a52726f5da55
files Gui/win32/interface.c
diffstat 1 files changed, 25 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/win32/interface.c	Fri Mar 02 00:29:06 2007 +0000
+++ b/Gui/win32/interface.c	Fri Mar 02 00:33:32 2007 +0000
@@ -431,6 +431,30 @@
     free((void **) &guiIntfStruct.Subtitlename);
 }
 
+void mplFullScreen( void )
+{
+    if(!guiIntfStruct.sh_video) return;
+
+    if(sub_window)
+    {
+        if(!fullscreen && IsWindowVisible(mygui->subwindow) && !IsIconic(mygui->subwindow))
+           GetWindowRect(mygui->subwindow, &old_rect);
+
+        if(fullscreen)
+        {
+            fullscreen = 0;
+            style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
+        } else {
+            fullscreen = 1;
+            style = WS_VISIBLE | WS_POPUP;
+        }
+        SetWindowLong(mygui->subwindow, GWL_STYLE, style);
+        update_subwindow();
+    }
+    video_out->control(VOCTRL_FULLSCREEN, 0);
+    if(sub_window) ShowWindow(mygui->subwindow, SW_SHOW);
+}
+
 static DWORD WINAPI GuiThread(void)
 {
     MSG msg;
@@ -643,31 +667,8 @@
             switch((int) arg)
             {
                 case MP_CMD_GUI_FULLSCREEN:
-                {
-                    if(!guiIntfStruct.sh_video) break;
-
-                    if(!sub_window)
-                    {
-                        video_out->control(VOCTRL_FULLSCREEN, 0);
-                        break;
-                    }
-
-                    if(!fullscreen && IsWindowVisible(mygui->subwindow) && !IsIconic(mygui->subwindow))
-                        GetWindowRect(mygui->subwindow, &old_rect);
-
-                    if(fullscreen)
-                    {
-                        fullscreen = 0;
-                        style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
-                    } else {
-                        fullscreen = 1;
-                        style = WS_VISIBLE | WS_POPUP;
-                    }
-                    SetWindowLong(mygui->subwindow, GWL_STYLE, style);
-                    mpcodecs_config_vo(guiIntfStruct.sh_video, guiIntfStruct.MovieWidth,
-                                       guiIntfStruct.MovieHeight, 0);
+                    mplFullScreen();
                     break;
-                }
                 case MP_CMD_QUIT:
                 {
                     mygui->uninit(mygui);