changeset 3830:fc1db33734e7

WinID cleanup, support for Xv
author arpi
date Fri, 28 Dec 2001 13:24:27 +0000
parents 30b4f0c45b6e
children 9926017e5efd
files libvo/vo_x11.c libvo/vo_xv.c libvo/x11_common.c libvo/x11_common.h
diffstat 4 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_x11.c	Fri Dec 28 12:03:52 2001 +0000
+++ b/libvo/vo_x11.c	Fri Dec 28 13:24:27 2001 +0000
@@ -71,9 +71,6 @@
 static int depth,bpp,mode;
 static XWindowAttributes attribs;
 
-/* output window id */
-int WinID=0;
-
 //static int vo_dwidth,vo_dheight;
 
 static int Flip_Flag;
@@ -284,8 +281,8 @@
      }
 #endif
  
-    if ( WinID ){
-      mywindow = (Window)WinID;
+    if ( WinID>=0 ){
+      mywindow = WinID ? ((Window)WinID) : RootWindow( mDisplay,mScreen );
       XUnmapWindow( mDisplay,mywindow );
       XChangeWindowAttributes( mDisplay,mywindow,xswamask,&xswa );
     }
--- a/libvo/vo_xv.c	Fri Dec 28 12:03:52 2001 +0000
+++ b/libvo/vo_xv.c	Fri Dec 28 13:24:27 2001 +0000
@@ -188,9 +188,16 @@
    xswa.border_pixel     = 0;
    xswamask = CWBackPixel | CWBorderPixel;
 
+    if ( WinID>=0 ){
+      mywindow = WinID ? ((Window)WinID) : RootWindow(mDisplay,mScreen);
+      XUnmapWindow( mDisplay,mywindow );
+      XChangeWindowAttributes( mDisplay,mywindow,xswamask,&xswa );
+    } else 
+
    mywindow = XCreateWindow(mDisplay, RootWindow(mDisplay,mScreen),
-   hint.x, hint.y, hint.width, hint.height,
-   0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa);
+       hint.x, hint.y, hint.width, hint.height,
+       0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa);
+
    vo_x11_classhint( mDisplay,mywindow,"xv" );
    vo_hidecursor(mDisplay,mywindow);
 
--- a/libvo/x11_common.c	Fri Dec 28 12:03:52 2001 +0000
+++ b/libvo/x11_common.c	Fri Dec 28 13:24:27 2001 +0000
@@ -45,6 +45,8 @@
 int mScreen;
 int mLocalDisplay;
 
+/* output window id */
+int WinID=-1;
 
 void vo_hidecursor ( Display *disp , Window win )
 {
--- a/libvo/x11_common.h	Fri Dec 28 12:03:52 2001 +0000
+++ b/libvo/x11_common.h	Fri Dec 28 13:24:27 2001 +0000
@@ -12,6 +12,7 @@
 extern Window mRootWin;
 extern int mScreen;
 extern int mLocalDisplay;
+extern int WinID;
 
 int vo_init( void );
 int vo_hidecursor ( Display* , Window );