changeset 6016:be9cd7d845c2

-zoom, -fs with x[11|mga|v] fix -- round two
author pontscho
date Wed, 08 May 2002 20:24:35 +0000
parents 04fe086ae486
children 12460040d86b
files libvo/vo_x11.c libvo/vo_xmga.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/x11_common.c mplayer.c
diffstat 6 files changed, 36 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_x11.c	Wed May 08 19:21:36 2002 +0000
+++ b/libvo/vo_x11.c	Wed May 08 20:24:35 2002 +0000
@@ -296,8 +296,8 @@
 //	hint.width=d_width;
 //	hint.height=d_height;
 //    }else{
-//	hint.width=width;
-//	hint.height=height;
+	hint.width=width;
+	hint.height=height;
 //    }
  
 #ifdef HAVE_XF86VM
--- a/libvo/vo_xmga.c	Wed May 08 19:21:36 2002 +0000
+++ b/libvo/vo_xmga.c	Wed May 08 20:24:35 2002 +0000
@@ -195,6 +195,9 @@
 
  unsigned long          xswamask;
 
+ if ( X_already_started ) return -1;
+ if (!vo_init()) return -1;
+
  width+=width&1;
 
  switch(format)
@@ -221,10 +224,6 @@
    default:          printf("mga: invalid output format %0X\n",format); return (-1);
   }
 
- if ( X_already_started ) return -1;
-
- if (!vo_init()) return -1;
-
  aspect_save_orig(width,height);
  aspect_save_prescale(d_width,d_height);
  aspect_save_screenres(vo_screenwidth,vo_screenheight);
@@ -234,9 +233,6 @@
  wndX=0; wndY=0;
  vo_dwidth=d_width; vo_dheight=d_height;
  vo_mouse_autohide=1;
-// vo_fs=fullscreen&1;
-// if ( vo_fs )
-//  { vo_old_width=d_width; vo_old_height=d_height; }
 
  switch ( vo_depthonscreen )
   {
@@ -249,7 +245,7 @@
 
   inited=1;
 
- aspect(&vo_dwidth,&vo_dheight,A_NOZOOM);
+  aspect(&vo_dwidth,&vo_dheight,A_NOZOOM);
 
 #ifdef HAVE_NEW_GUI
   if(use_gui)
@@ -257,14 +253,9 @@
   else
 #endif
   {
-   if ( vo_fs )
-    {
-//     vo_dwidth=vo_screenwidth;
-//     vo_dheight=vo_screenheight;
 #ifdef X11_FULLSCREEN
-     aspect(&dwidth,&dheight,A_ZOOM);
+   if ( fullscreen&1 ) aspect(&dwidth,&dheight,A_ZOOM);
 #endif
-    }
 
    XGetWindowAttributes( mDisplay,DefaultRootWindow( mDisplay ),&attribs );
    mDepth=attribs.depth;
@@ -282,7 +273,7 @@
       XUnmapWindow( mDisplay,vo_window );
       XChangeWindowAttributes( mDisplay,vo_window,xswamask,&xWAttribs);
     } else 
-   vo_window=XCreateWindow( mDisplay,RootWindow( mDisplay,mScreen ),
+   vo_window=XCreateWindow( mDisplay,mRootWin,
      wndX,wndY,
      vo_dwidth,vo_dheight,
      xWAttribs.border_pixel,
--- a/libvo/vo_xv.c	Wed May 08 19:21:36 2002 +0000
+++ b/libvo/vo_xv.c	Wed May 08 20:24:35 2002 +0000
@@ -786,6 +786,8 @@
 static void uninit(void) 
 {
  int i;
+#if 0
+
  if(!mDisplay) return;
  saver_on(mDisplay); // screen saver back on
  if(vo_config_count) for( i=0;i<num_buffers;i++ ) deallocate_xvimage( i );
@@ -793,11 +795,24 @@
  vo_vm_close(mDisplay);
 #endif
  if(vo_config_count) vo_x11_uninit(mDisplay, vo_window);
+
+#else
+
+ if ( !vo_config_count ) return;
+ saver_on(mDisplay); // screen saver back on
+ for( i=0;i<num_buffers;i++ ) deallocate_xvimage( i );
+#ifdef HAVE_XF86VM
+ vo_vm_close(mDisplay);
+#endif
+ vo_x11_uninit(mDisplay, vo_window);
+
+#endif
 }
 
 static uint32_t preinit(const char *arg)
 {
     XvPortID xv_p;
+    
     if(arg) 
     {
 	mp_msg(MSGT_VO,MSGL_ERR,"vo_xv: Unknown subdevice: %s\n",arg);
--- a/libvo/vo_xvidix.c	Wed May 08 19:21:36 2002 +0000
+++ b/libvo/vo_xvidix.c	Wed May 08 20:24:35 2002 +0000
@@ -437,6 +437,7 @@
 
 static uint32_t preinit(const char *arg)
 {
+
     if (arg)
         vidix_name = strdup(arg);
     else
--- a/libvo/x11_common.c	Wed May 08 19:21:36 2002 +0000
+++ b/libvo/x11_common.c	Wed May 08 20:24:35 2002 +0000
@@ -358,9 +358,11 @@
 
 void vo_uninit( void )
 {
+ if( !vo_depthonscreen ) return;
  printf("vo: uninit ...\n" );
- if( !vo_depthonscreen ) return;
+ XSetErrorHandler(NULL);
  XCloseDisplay( mDisplay );
+ vo_depthonscreen = 0;
 }
 
 #include "../linux/keycodes.h"
@@ -509,7 +511,6 @@
 
 int vo_x11_uninit(Display *display, Window window)
 {
-    XSetErrorHandler(NULL);
     vo_showcursor( display,window );
 
 #ifdef HAVE_NEW_GUI
@@ -518,9 +519,11 @@
 #endif
     {
 	/* and -wid is set */
-	if (!(WinID > 0))
-	    XDestroyWindow(display, window);
-	vo_depthonscreen = 0;
+	if (WinID < 0)
+	 {
+	  XUnmapWindow( display,window );
+	  XDestroyWindow(display, window);
+	 }
 	vo_fs=0;
     }
     return(1);
@@ -724,11 +727,8 @@
 
  switch ( vo_wm_type )
   {
-//   case vo_wm_WMakerStyle:
-//          vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 1 : 0 );
-	  break;
    case vo_wm_Unknown:
-//          vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 1 : 0 );
+	  vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 1 : 0 );
 	  XUnmapWindow( mDisplay,vo_window );
 	  break;
    case vo_wm_IceWM:
--- a/mplayer.c	Wed May 08 19:21:36 2002 +0000
+++ b/mplayer.c	Wed May 08 20:24:35 2002 +0000
@@ -355,6 +355,9 @@
 
   uninit_player(INITED_ALL);
 #ifdef X11_FULLSCREEN
+#ifdef HAVE_NEW_GUI
+  if ( !use_gui )
+#endif
   vo_uninit();	// close the X11 connection (if any opened)
 #endif