[Mplayer-advusers] trouble with the -vm option

Christian Ohm chr.ohm at gmx.net
Tue Jun 25 01:13:47 CEST 2002


hi.

i've tested your little circuit and have to say it works really well. and
i've encountered the problem you described. i found two ways around it: the
first is a patch to mplayer, that adds a -grabmouse option (grabmouse=0 in
the config file) so mplayer doesn't grab the cursor anymore. and (by pure
chance) it doesn't unpause when any key is pressed.

the second is a little program i called wctd (warp cursor to display) that
just takes the desired display as argument (or the one set in DISPLAY) and
moves the cursor to it. bind to some keys and move the cursor around as you
like.

since my x-programming-skills are severly lacking (as in virtually
non-existant), i don't think either solution is perfect, but works.

i hope that helps.

bye
christian ohm

-- 
GREAT MOMENTS IN HISTORY (#7):  November 23, 1915

Pancake make-up is invented; most people continue to prefer syrup.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wctd.c
Type: text/x-csrc
Size: 1538 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-advusers/attachments/20020625/3cd39c3c/attachment.c>
-------------- next part --------------
? grabpointer.patch
Index: .cvsignore
===================================================================
RCS file: /cvsroot/mplayer/main/.cvsignore,v
retrieving revision 1.11
diff -u -r1.11 .cvsignore
--- .cvsignore	15 May 2002 20:28:59 -0000	1.11
+++ .cvsignore	19 Jun 2002 22:17:46 -0000
@@ -1,3 +1,7 @@
+conf
+cscope.out
+fibmap_mplayer
+makedeb
 .depend
 .developer
 config.h
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.154
diff -u -r1.154 cfg-mplayer.h
--- cfg-mplayer.h	4 Jun 2002 20:17:05 -0000	1.154
+++ cfg-mplayer.h	19 Jun 2002 22:17:47 -0000
@@ -71,6 +71,7 @@
 extern int WinID;
 extern int ice_layer;
 extern int stop_xscreensaver;
+extern int grabpointer;
 #endif
 
 #ifdef HAVE_AA
@@ -248,6 +249,11 @@
 	{"icelayer", &ice_layer, CONF_TYPE_INT, CONF_RANGE, 0, 15, NULL},
 	{"stop_xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 0, 1, NULL},
 	{"nostop_xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+#endif
+
+#ifdef HAVE_XF86VM
+	{"grabpointer", &grabpointer, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"nograbpointer", &grabpointer, CONF_TYPE_FLAG, 0, 1, 0, NULL},
 #endif
 
 #ifdef HAVE_XINERAMA
Index: libvo/vo_dga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dga.c,v
retrieving revision 1.45
diff -u -r1.45 vo_dga.c
--- libvo/vo_dga.c	27 May 2002 17:14:13 -0000	1.45
+++ libvo/vo_dga.c	19 Jun 2002 22:17:52 -0000
@@ -1114,9 +1114,10 @@
   
   XGrabKeyboard (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True, 
                  GrabModeAsync,GrabModeAsync, CurrentTime);
-  XGrabPointer (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True, 
-                ButtonPressMask,GrabModeAsync, GrabModeAsync, 
-                None, None, CurrentTime);
+  if (grabpointer)
+    XGrabPointer (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True, 
+                  ButtonPressMask,GrabModeAsync, GrabModeAsync, 
+                  None, None, CurrentTime);
 // TODO: chekc if mem of graphics adaptor is large enough for dbf
 
   // set up variables for double buffering ...
Index: libvo/vo_fsdga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fsdga.c,v
retrieving revision 1.12
diff -u -r1.12 vo_fsdga.c
--- libvo/vo_fsdga.c	27 May 2002 17:56:52 -0000	1.12
+++ libvo/vo_fsdga.c	19 Jun 2002 22:17:53 -0000
@@ -373,9 +373,10 @@
   
   XGrabKeyboard (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True, 
                  GrabModeAsync,GrabModeAsync, CurrentTime);
-  XGrabPointer (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True, 
-                ButtonPressMask,GrabModeAsync, GrabModeAsync, 
-                None, None, CurrentTime);
+  if (grabpointer)
+    XGrabPointer (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True, 
+                  ButtonPressMask,GrabModeAsync, GrabModeAsync, 
+                  None, None, CurrentTime);
    
   // now clear screen
 
Index: libvo/vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.109
diff -u -r1.109 vo_x11.c
--- libvo/vo_x11.c	24 May 2002 21:58:05 -0000	1.109
+++ libvo/vo_x11.c	19 Jun 2002 22:17:55 -0000
@@ -368,9 +368,10 @@
     if ( vm )
      {
       /* Grab the mouse pointer in our window */
-      XGrabPointer(mDisplay, vo_window, True, 0,
-                   GrabModeAsync, GrabModeAsync,
-                   vo_window, None, CurrentTime);
+      if (grabpointer)
+            XGrabPointer(mDisplay, vo_window, True, 0,
+                         GrabModeAsync, GrabModeAsync,
+                         vo_window, None, CurrentTime);
       XSetInputFocus(mDisplay, vo_window, RevertToNone, CurrentTime);
      }
 #endif
Index: libvo/vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.100
diff -u -r1.100 vo_xv.c
--- libvo/vo_xv.c	13 Jun 2002 15:08:37 -0000	1.100
+++ libvo/vo_xv.c	19 Jun 2002 22:17:57 -0000
@@ -463,9 +463,10 @@
     if ( vm )
      {
       /* Grab the mouse pointer in our window */
-      XGrabPointer(mDisplay, vo_window, True, 0,
-                   GrabModeAsync, GrabModeAsync,
-                   vo_window, None, CurrentTime);
+      if (grabpointer)
+            XGrabPointer(mDisplay, vo_window, True, 0,
+                         GrabModeAsync, GrabModeAsync,
+                         vo_window, None, CurrentTime);
       XSetInputFocus(mDisplay, vo_window, RevertToNone, CurrentTime);
      }
 #endif
Index: libvo/x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.93
diff -u -r1.93 x11_common.c
--- libvo/x11_common.c	12 Jun 2002 22:57:58 -0000	1.93
+++ libvo/x11_common.c	19 Jun 2002 22:18:11 -0000
@@ -82,6 +82,7 @@
 int xinerama_y = 0;
 #endif
 #ifdef HAVE_XF86VM
+int grabpointer=1;
 XF86VidModeModeInfo **vidmodes=NULL;
 XF86VidModeModeLine modeline;
 #endif
@@ -867,7 +868,7 @@
       mp_msg(MSGT_VO,MSGL_V,"XF86VidMode Extension v%i.%i\n", vm_ver, vm_rev);
       have_vm=1;
     } else
-      mp_msg(MSGT_VO,MSGL_WARN,"XF86VidMode Extenstion not available.\n");
+      mp_msg(MSGT_VO,MSGL_WARN,"XF86VidMode Extension not available.\n");
 
     if (have_vm) {
       if (vidmodes==NULL)
Index: libvo/x11_common.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.h,v
retrieving revision 1.25
diff -u -r1.25 x11_common.h
--- libvo/x11_common.h	13 Jun 2002 00:26:17 -0000	1.25
+++ libvo/x11_common.h	19 Jun 2002 22:18:11 -0000
@@ -55,6 +55,7 @@
 #endif
 
 #ifdef HAVE_XF86VM
+extern int grabpointer;
 void vo_vm_switch(uint32_t, uint32_t, int*, int*);
 void vo_vm_close(Display*);
 #endif


More information about the MPlayer-advusers mailing list