changeset 7764:13c36b2d1d45

-fixed-vo support
author pontscho
date Wed, 16 Oct 2002 22:29:00 +0000
parents cdb43addad4c
children dbf1e5cfadbd
files libvo/vo_x11.c
diffstat 1 files changed, 18 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_x11.c	Wed Oct 16 21:32:03 2002 +0000
+++ b/libvo/vo_x11.c	Wed Oct 16 22:29:00 2002 +0000
@@ -49,7 +49,7 @@
 static unsigned char *ImageData;
 
 /* X11 related variables */
-static XImage *myximage;
+static XImage *myximage = NULL;
 static int depth,bpp,mode;
 static XWindowAttributes attribs;
 
@@ -275,12 +275,6 @@
   else
 #endif   
    {
-     if(vo_window != None) {
-       freeMyXImage();
-       XUnmapWindow( mDisplay,vo_window );
-       XDestroyWindow(mDisplay, vo_window);
-     }
-
 #ifdef HAVE_XF86VM
     if ( vm )
    {
@@ -325,24 +319,27 @@
     }
     else
      {
-      vo_window=XCreateWindow( mDisplay,mRootWin,
+      if ( vo_window == None )
+       {
+        vo_window=XCreateWindow( mDisplay,mRootWin,
     			 vo_dx,vo_dy,
 			 vo_dwidth,vo_dheight,
                          xswa.border_pixel,depth,CopyFromParent,vinfo.visual,xswamask,&xswa );
 
-      vo_x11_classhint( mDisplay,vo_window,"x11" );
-      vo_hidecursor(mDisplay,vo_window);
-      vo_x11_sizehint( vo_dx,vo_dy,vo_dwidth,vo_dheight,0 );
-      XSelectInput( mDisplay,vo_window,StructureNotifyMask );
-      XStoreName( mDisplay,vo_window,title );
-      XMapWindow( mDisplay,vo_window );
-      if(WinID!=0)
-         do { XNextEvent( mDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != vo_window );
-
-      if ( fullscreen ) vo_x11_fullscreen();
+        vo_x11_classhint( mDisplay,vo_window,"x11" );
+        vo_hidecursor(mDisplay,vo_window);
+        vo_x11_sizehint( vo_dx,vo_dy,vo_dwidth,vo_dheight,0 );
+        XSelectInput( mDisplay,vo_window,StructureNotifyMask );
+        XStoreName( mDisplay,vo_window,title );
+        XMapWindow( mDisplay,vo_window );
+//      if(WinID!=0)
+           do { XNextEvent( mDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != vo_window );
+ 
+        if ( fullscreen ) vo_x11_fullscreen();
 #ifdef HAVE_XINERAMA
-      vo_x11_xinerama_move(mDisplay,vo_window);
+        vo_x11_xinerama_move(mDisplay,vo_window);
 #endif
+      } else if ( !fullscreen ) XMoveResizeWindow( mDisplay,vo_window,vo_dx,vo_dy,vo_dwidth,vo_dheight );
      }
 
     XFlush( mDisplay );
@@ -366,6 +363,8 @@
    }
 
   vo_gc=XCreateGC( mDisplay,vo_window,0L,&xgcv );
+  
+  if ( myximage ) freeMyXImage();
   getMyXImage();
   
   if ( !WinID )