[Mplayer-cvslog] CVS: main/libvo video_out.h,1.31,1.32 vo_gl.c,1.24,1.25 vo_gl2.c,1.17,1.18 vo_x11.c,1.91,1.92 vo_xmga.c,1.56,1.57 vo_xv.c,1.71,1.72 vo_xvidix.c,1.28,1.29 x11_common.c,1.63,1.64 x11_common.h,1.17,1.18

Zoltan Ponekker pontscho at mplayerhq.banki.hu
Tue Apr 16 19:41:32 CEST 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv24907/libvo

Modified Files:
	video_out.h vo_gl.c vo_gl2.c vo_x11.c vo_xmga.c vo_xv.c 
	vo_xvidix.c x11_common.c x11_common.h 
Log Message:
fix playlist bug with gui and rewrite mousecursor show/hide code

Index: video_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- video_out.h	7 Apr 2002 02:12:15 -0000	1.31
+++ video_out.h	16 Apr 2002 17:41:29 -0000	1.32
@@ -216,6 +216,8 @@
 extern int vo_fs;
 extern int vo_fsmode;
 
+extern int vo_mouse_timer_const;
+
 extern int vo_pts;
 extern float vo_fps;
 

Index: vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- vo_gl.c	17 Feb 2002 08:24:43 -0000	1.24
+++ vo_gl.c	16 Apr 2002 17:41:29 -0000	1.25
@@ -208,7 +208,7 @@
 //	bpp = myximage->bits_per_pixel;
 
 	//XSelectInput(mDisplay, mywindow, StructureNotifyMask); // !!!!
-        XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask 
+        XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask | PointerMotionMask
 #ifdef HAVE_NEW_INPUT
 		     | ButtonPressMask | ButtonReleaseMask
 #endif

Index: vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- vo_gl2.c	17 Feb 2002 08:24:43 -0000	1.17
+++ vo_gl2.c	16 Apr 2002 17:41:29 -0000	1.18
@@ -712,7 +712,7 @@
 	XSync(mDisplay, False);
 
 	//XSelectInput(mDisplay, mywindow, StructureNotifyMask); // !!!!
-        XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask
+        XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask | PointerMotionMask
 #ifdef HAVE_NEW_INPUT
 		 | ButtonPressMask | ButtonReleaseMask
 #endif

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- vo_x11.c	13 Apr 2002 19:14:33 -0000	1.91
+++ vo_x11.c	16 Apr 2002 17:41:29 -0000	1.92
@@ -359,7 +359,7 @@
     XSync( mDisplay,False );
     vo_gc=XCreateGC( mDisplay,vo_window,0L,&xgcv );
 
-    XSelectInput( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask);
+    XSelectInput( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask);
 
 #ifdef HAVE_XF86VM
     if ( vm )

Index: vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- vo_xmga.c	31 Mar 2002 20:45:31 -0000	1.56
+++ vo_xmga.c	16 Apr 2002 17:41:29 -0000	1.57
@@ -278,7 +278,7 @@
    xWAttribs.colormap=XCreateColormap( mDisplay,RootWindow( mDisplay,mScreen ),vinfo.visual,AllocNone );
    xWAttribs.background_pixel=0;
    xWAttribs.border_pixel=0;
-   xWAttribs.event_mask=StructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask;
+   xWAttribs.event_mask=StructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
    xswamask=CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
 
     if ( WinID>=0 ){
@@ -341,6 +341,8 @@
 {
  if(!inited) return;
  inited=0;
+ XSetBackground( mDisplay,vo_gc,0 );
+ XClearWindow( mDisplay,vo_window );
  mga_uninit();
  saver_on(mDisplay);
  vo_x11_uninit(mDisplay, vo_window);

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- vo_xv.c	14 Apr 2002 22:15:29 -0000	1.71
+++ vo_xv.c	16 Apr 2002 17:41:29 -0000	1.72
@@ -416,7 +416,7 @@
    vo_x11_classhint( mDisplay,vo_window,"xv" );
    vo_hidecursor(mDisplay,vo_window);
 
-   XSelectInput(mDisplay, vo_window, StructureNotifyMask | KeyPressMask 
+   XSelectInput(mDisplay, vo_window, StructureNotifyMask | KeyPressMask | PointerMotionMask
 #ifdef HAVE_NEW_INPUT
 		| ButtonPressMask | ButtonReleaseMask
 #endif

Index: vo_xvidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xvidix.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- vo_xvidix.c	24 Mar 2002 21:22:16 -0000	1.28
+++ vo_xvidix.c	16 Apr 2002 17:41:29 -0000	1.29
@@ -290,7 +290,7 @@
     xswa.border_pixel     = 0;
     xswa.colormap         = XCreateColormap(mDisplay, RootWindow(mDisplay, mScreen),
 					    vinfo.visual, AllocNone);
-    xswa.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask;
+    xswa.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
     xswamask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
 
     if (WinID >= 0)

Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- x11_common.c	9 Apr 2002 13:18:45 -0000	1.63
+++ x11_common.c	16 Apr 2002 17:41:29 -0000	1.64
@@ -86,8 +86,11 @@
 	bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8,8);    
 	no_ptr=XCreatePixmapCursor(disp, bm_no, bm_no,&black, &black,0, 0);									          
 	XDefineCursor(disp,win,no_ptr);
+	XFreeCursor( disp,no_ptr );
 }
 
+void vo_showcursor( Display *disp, Window win )
+{ XDefineCursor( disp,win,0 ); }
 
 #ifdef	SCAN_VISUALS
 /*
@@ -447,14 +450,20 @@
     return(1);
 }
 
+       int vo_mouse_timer_const = 30;
+static int vo_mouse_counter = 30;
+
 int vo_x11_check_events(Display *mydisplay){
  int ret=0;
  XEvent         Event;
  char           buf[100];
  KeySym         keySym;
  static XComposeStatus stat;
+
 // unsigned long  vo_KeyTable[512];
 
+ if ( --vo_mouse_counter == 0 ) vo_hidecursor( mydisplay,vo_window );
+ 
  while ( XPending( mydisplay ) )
   {
    XNextEvent( mydisplay,&Event );
@@ -503,8 +512,12 @@
             ret|=VO_EVENT_KEYPRESS;
 	   }
            break;
+      case MotionNotify:
+           vo_showcursor( mydisplay,vo_window ); vo_mouse_counter=vo_mouse_timer_const;
+           break;
 #ifdef HAVE_NEW_INPUT
       case ButtonPress:
+           vo_showcursor( mydisplay,vo_window ); vo_mouse_counter=vo_mouse_timer_const;
            // Ignore mouse whell press event
            if(Event.xbutton.button == 4 || Event.xbutton.button == 5) break;
 	   #ifdef HAVE_NEW_GUI
@@ -514,6 +527,7 @@
            mplayer_put_key((MOUSE_BTN0+Event.xbutton.button-1)|MP_KEY_DOWN);
            break;
       case ButtonRelease:
+           vo_showcursor( mydisplay,vo_window ); vo_mouse_counter=vo_mouse_timer_const;
            #ifdef HAVE_NEW_GUI
 	    // Ignor mouse button 1 - 3 under gui 
 	    if ( use_gui && ( Event.xbutton.button >= 1 )&&( Event.xbutton.button <= 3 ) ) break;

Index: x11_common.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- x11_common.h	8 Mar 2002 20:14:08 -0000	1.17
+++ x11_common.h	16 Apr 2002 17:41:29 -0000	1.18
@@ -21,8 +21,11 @@
 extern int mLocalDisplay;
 extern int WinID;
 
+extern int vo_mouse_timer_const;
+
 int vo_init( void );
 int vo_hidecursor ( Display* , Window );
+extern void vo_showcursor( Display *disp, Window win );
 void vo_x11_decoration( Display * vo_Display,Window w,int d );
 void vo_x11_classhint( Display * display,Window window,char *name );
 void vo_x11_sizehint( int x, int y, int width, int height );




More information about the MPlayer-cvslog mailing list