[MPlayer-dev-eng] vo_x11.c: vm
Uwe Reder
Uwe.Reder at 3SOFT.de
Fri Oct 5 10:13:59 CEST 2001
On Thursday, 4. October 2001 11:26, Felix Bueneman wrote:
>> I subscribed to the mailing list to send a patch that improves
>> vm-fullscreen in vo_x11. In vm-fullscreen it was easy to move the video out
>> of the visible screen (view port) by touching the mouse. Moreover, even on
>> startup the video was not fully centered.
> pleasre resend patch as readable diff (diff -Naur).
Here you go:
--- MPlayer-0.50pre1/libvo/vo_x11.c Thu Sep 20 12:26:22 2001
+++ vo_x11.c Wed Oct 3 23:09:12 2001
@@ -149,6 +149,7 @@
Colormap theCmap;
XSetWindowAttributes xswa;
unsigned long xswamask;
+ unsigned int modeline_width, modeline_height;
image_height=height;
image_width=width;
@@ -182,7 +183,7 @@
#ifdef HAVE_XF86VM
if (vm) {
- unsigned int modeline_width, modeline_height, vm_event, vm_error;
+ unsigned int vm_event, vm_error;
unsigned int vm_ver, vm_rev;
int i,j,have_vm=0,X,Y;
@@ -226,7 +227,16 @@
}
#endif
-
+#ifdef HAVE_XF86VM
+ if ( vm )
+ {
+ hint.x=(vo_screenwidth-modeline_width)/2;
+ hint.y=(vo_screenheight-modeline_height)/2;
+ hint.width=modeline_width;
+ hint.height=modeline_height;
+ }
+ else
+#endif
if ( fullscreen )
{
hint.width=vo_screenwidth;
@@ -243,14 +253,23 @@
vinfo.visual,AllocNone );
xswa.background_pixel=0;
- xswa.border_pixel=1;
+ xswa.border_pixel=0;
xswa.colormap=theCmap;
- xswamask=CWBackPixel | CWBorderPixel |CWColormap;
+ xswamask=CWBackPixel | CWBorderPixel | CWColormap;
+#ifdef HAVE_XF86VM
+ if ( vm )
+ {
+ xswa.override_redirect=True;
+ xswamask|=CWOverrideRedirect;
+ }
+#endif
+
mywindow=XCreateWindow( mDisplay,RootWindow( mDisplay,mScreen ),
hint.x,hint.y,
hint.width,hint.height,
xswa.border_pixel,depth,CopyFromParent,vinfo.visual,xswamask,&xswa );
+
vo_x11_classhint( mDisplay,mywindow,"x11" );
vo_hidecursor(mDisplay,mywindow);
if ( fullscreen ) vo_x11_decoration( mDisplay,mywindow,0 );
@@ -262,8 +281,18 @@
XFlush( mDisplay );
XSync( mDisplay,False );
-
mygc=XCreateGC( mDisplay,mywindow,0L,&xgcv );
+
+#ifdef HAVE_XF86VM
+ if ( vm )
+ {
+ /* Grab the mouse pointer in our window */
+ XGrabPointer(mDisplay, mywindow, True, 0,
+ GrabModeAsync, GrabModeAsync,
+ mywindow, None, CurrentTime);
+ XSetInputFocus(mDisplay, mywindow, RevertToNone, CurrentTime);
+ }
+#endif
}
#ifdef SH_MEM
More information about the MPlayer-dev-eng
mailing list