[MPlayer-cvslog] r19541 - in trunk/Gui/win32: gui.c interface.c

vayne subversion at mplayerhq.hu
Sat Aug 26 18:52:52 CEST 2006


Author: vayne
Date: Sat Aug 26 18:52:51 2006
New Revision: 19541

Modified:
   trunk/Gui/win32/gui.c
   trunk/Gui/win32/interface.c

Log:
Further fullscreen switching improvements. Fixes sub window position bug when exiting a file from fullscreen. Fixes sub window position when switching between windows and fullscreen modes.

Modified: trunk/Gui/win32/gui.c
==============================================================================
--- trunk/Gui/win32/gui.c	(original)
+++ trunk/Gui/win32/gui.c	Sat Aug 26 18:52:51 2006
@@ -309,6 +309,17 @@
     if((time - oldtime) < 100) return;
     oldtime=time;
 
+    /* suppress directx's fullscreen window when using the sub window */
+    if(sub_window && &video_driver_list[0] && strstr("directx", video_driver_list[0]))
+    {
+        HWND hWndFS = NULL; //handle to directx's fullscreen window
+        if(hWndFS == NULL)
+        {
+            hWndFS = FindWindow(NULL, "MPlayer Fullscreen");
+            if(hWndFS != NULL) DestroyWindow(hWndFS); //sub window handles fullscreen
+        }
+    }
+
     for (i=0; i<gui->window_priv_count; i++)
     {
         if(gui->window_priv[i]->hwnd == hwnd)

Modified: trunk/Gui/win32/interface.c
==============================================================================
--- trunk/Gui/win32/interface.c	(original)
+++ trunk/Gui/win32/interface.c	Sat Aug 26 18:52:51 2006
@@ -68,6 +68,7 @@
 static gui_t *mygui = NULL;
 static int update_subwindow(void);
 static RECT old_rect;
+static DWORD style;
 
 /* test for playlist files, no need to specify -playlist on the commandline.
  * add any conceivable playlist extensions here.
@@ -404,6 +405,11 @@
         mygui->playlist->current = 0;
 
     fullscreen = 0;
+    if(style == WS_VISIBLE | WS_POPUP)
+    {
+        style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
+        SetWindowLong(mygui->subwindow, GWL_STYLE, style);
+    }
     guiGetEvent(guiCEvent, (void *) guiSetStop);
 }
 
@@ -434,9 +440,6 @@
        gtkAutoSync = autosync;
     }
 
-    old_rect.left = gui_sub_pos_x;
-    old_rect.top = gui_sub_pos_y;
-
     while(mygui)
     {
         GetMessage(&msg, NULL, 0, 0);
@@ -670,9 +673,6 @@
                 case guiSetPlay:
                 {
                     guiIntfStruct.Playing = 1;
-                    if(guiIntfStruct.sh_video && !IsIconic(mygui->subwindow)
-                       && IsWindowVisible(mygui->subwindow) && !fullscreen)
-                        GetWindowRect(mygui->subwindow, &old_rect);
                     break;
                 }
                 case guiSetStop:
@@ -697,10 +697,6 @@
             {
                 case MP_CMD_GUI_FULLSCREEN:
                 {
-                    DWORD style;
-                    /* vo_directx's fullscreen window */
-                    HWND hWndFS = FindWindow(NULL, "MPlayer Fullscreen");
-
                     if(!guiIntfStruct.sh_video) break;
 
                     if(!sub_window)
@@ -719,7 +715,6 @@
                     } else {
                         fullscreen = 1;
                         style = WS_VISIBLE | WS_POPUP;
-                        if(hWndFS) DestroyWindow(hWndFS);
                     }
                     SetWindowLong(mygui->subwindow, GWL_STYLE, style);
                     mpcodecs_config_vo(guiIntfStruct.sh_video, guiIntfStruct.MovieWidth,
@@ -944,14 +939,15 @@
         ShowWindow(mygui->subwindow, SW_SHOWNORMAL);
 
     /* get our current window coordinates */
-    if(fullscreen)
-        GetWindowRect(mygui->subwindow, &rd);
-    else
-        CopyRect(&rd, &old_rect);
+    GetWindowRect(mygui->subwindow, &rd);
 
     x = rd.left;
     y = rd.top;
 
+    /* restore sub window position when coming out of fullscreen */
+    if(x <= 0) x = old_rect.left;
+    if(y <= 0) y = old_rect.top;
+
     if(!guiIntfStruct.Playing)
     {
         window *desc = NULL;



More information about the MPlayer-cvslog mailing list