changeset 15540:91d210e8a19c

Make -wid behave more consistent. Original patch by kiriuja |mplayer-patches >ta< en-directo >tod< net|
author al
date Sat, 21 May 2005 17:31:44 +0000
parents a66885bcbebe
children 18cb1e836289
files libvo/vo_x11.c libvo/vo_xmga.c libvo/vo_xover.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/vo_xvmc.c
diffstat 6 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_x11.c	Sat May 21 16:22:44 2005 +0000
+++ b/libvo/vo_x11.c	Sat May 21 17:31:44 2005 +0000
@@ -377,6 +377,8 @@
             vo_window = WinID ? ((Window) WinID) : mRootWin;
             if (WinID)
             {
+                int border;
+                Window win;
                 XUnmapWindow(mDisplay, vo_window);
                 XChangeWindowAttributes(mDisplay, vo_window, xswamask,
                                         &xswa);
@@ -389,6 +391,9 @@
                                            ButtonReleaseMask |
                                            ExposureMask);
                 XMapWindow(mDisplay, vo_window);
+                XGetGeometry(mDisplay, vo_window, &mRootWin,
+                             &vo_dx, &vo_dy, &vo_dwidth, &vo_dheight,
+                             &border, &depth);
             } else
                 XSelectInput(mDisplay, vo_window, ExposureMask);
         } else
--- a/libvo/vo_xmga.c	Sat May 21 16:22:44 2005 +0000
+++ b/libvo/vo_xmga.c	Sat May 21 17:31:44 2005 +0000
@@ -213,6 +213,7 @@
                                            ButtonPressMask |
                                            ButtonReleaseMask |
                                            ExposureMask);
+                XMapWindow(mDisplay, vo_window);
             } else
                 XSelectInput(mDisplay, vo_window, ExposureMask);
 
--- a/libvo/vo_xover.c	Sat May 21 16:22:44 2005 +0000
+++ b/libvo/vo_xover.c	Sat May 21 17:31:44 2005 +0000
@@ -300,6 +300,7 @@
 	      XUnmapWindow(mDisplay, vo_window);
 	      XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa);
 	      vo_x11_selectinput_witherr( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask );
+	      XMapWindow(mDisplay, vo_window);
 	    } else XSelectInput( mDisplay,vo_window,ExposureMask );
 	}
       else
--- a/libvo/vo_xv.c	Sat May 21 16:22:44 2005 +0000
+++ b/libvo/vo_xv.c	Sat May 21 17:31:44 2005 +0000
@@ -298,6 +298,11 @@
                                            ButtonReleaseMask |
                                            ExposureMask);
                 XMapWindow(mDisplay, vo_window);
+                XGetGeometry(mDisplay, vo_window, &mRoot,
+                             &drwX, &drwY, &vo_dwidth, &vo_dheight,
+                             &drwBorderWidth, &drwDepth);
+                drwX = drwY = 0; // coordinates need to be local to the window
+                aspect_save_prescale(vo_dwidth, vo_dheight);
             } else
             {
                 drwX = vo_dx;
--- a/libvo/vo_xvidix.c	Sat May 21 16:22:44 2005 +0000
+++ b/libvo/vo_xvidix.c	Sat May 21 17:31:44 2005 +0000
@@ -347,6 +347,7 @@
                                            ButtonPressMask |
                                            ButtonReleaseMask |
                                            ExposureMask);
+                XMapWindow(mDisplay, vo_window);
             } else
                 XSelectInput(mDisplay, vo_window, ExposureMask);
         } else
--- a/libvo/vo_xvmc.c	Sat May 21 16:22:44 2005 +0000
+++ b/libvo/vo_xvmc.c	Sat May 21 17:31:44 2005 +0000
@@ -666,10 +666,17 @@
       vo_window = WinID ? ((Window)WinID) : mRootWin;
       if ( WinID ) 
       {
+         Window mRoot;
+         uint32_t drwBorderWidth, drwDepth;
          XUnmapWindow( mDisplay,vo_window );
          XChangeWindowAttributes( mDisplay,vo_window,xswamask,&xswa );
 	 vo_x11_selectinput_witherr( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask );
          XMapWindow( mDisplay,vo_window );
+         XGetGeometry(mDisplay, vo_window, &mRoot,
+                      &drwX, &drwY, &vo_dwidth, &vo_dheight,
+                      &drwBorderWidth, &drwDepth);
+         drwX = drwY = 0; // coordinates need to be local to the window
+         aspect_save_prescale(vo_dwidth, vo_dheight);
       } else { drwX=vo_dx; drwY=vo_dy; }
    } else 
       if ( vo_window == None ){