[MPlayer-cvslog] r22407 - trunk/Gui/win32/interface.c

vayne subversion at mplayerhq.hu
Fri Mar 2 01:33:32 CET 2007


Author: vayne
Date: Fri Mar  2 01:33:32 2007
New Revision: 22407

Modified:
   trunk/Gui/win32/interface.c

Log:
simplify and modify fullscreen switching to avoid improper aspects

Modified: trunk/Gui/win32/interface.c
==============================================================================
--- trunk/Gui/win32/interface.c	(original)
+++ trunk/Gui/win32/interface.c	Fri Mar  2 01:33:32 2007
@@ -431,6 +431,30 @@ void mplSetFileName(char *dir, char *nam
     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 @@ int guiGetEvent(int type, char *arg)
             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);



More information about the MPlayer-cvslog mailing list