changeset 384:b0e4e5744899

Autohide X11 cursor
author lgb
date Fri, 13 Apr 2001 00:54:05 +0000
parents 086c66d570d8
children 3360c39a6bb7
files libvo/vo_gl.c libvo/vo_x11.c libvo/vo_xmga.c libvo/vo_xv.c libvo/x11_common.c libvo/x11_common.h
diffstat 6 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl.c	Thu Apr 12 23:23:29 2001 +0000
+++ b/libvo/vo_gl.c	Fri Apr 13 00:54:05 2001 +0000
@@ -183,6 +183,7 @@
 
   mywindow = XCreateWindow(mydisplay, RootWindow(mydisplay,screen),
     hint.x, hint.y, hint.width, hint.height, 4, vinfo->depth,CopyFromParent,vinfo->visual,xswamask,&xswa);
+  vo_hidecursor(mydisplay,mywindow);
 
   wsGLXContext=glXCreateContext( mydisplay,vinfo,NULL,True );
 //  XStoreName( wsDisplay,wsMyWin,wsSysName );
--- a/libvo/vo_x11.c	Thu Apr 12 23:23:29 2001 +0000
+++ b/libvo/vo_x11.c	Fri Apr 13 00:54:05 2001 +0000
@@ -225,6 +225,7 @@
                          hint.x,hint.y,
                          hint.width,hint.height,
                          xswa.border_pixel,depth,CopyFromParent,vinfo.visual,xswamask,&xswa );
+ vo_hidecursor(mDisplay,mywindow);
 
  if ( fullscreen ) vo_x11_decoration( mDisplay,mywindow,0 );
  XSelectInput( mDisplay,mywindow,StructureNotifyMask );
--- a/libvo/vo_xmga.c	Thu Apr 12 23:23:29 2001 +0000
+++ b/libvo/vo_xmga.c	Fri Apr 13 00:54:05 2001 +0000
@@ -244,6 +244,7 @@
    mDepth,
    InputOutput,
    vinfo.visual,xswamask,&xWAttribs );
+ vo_hidecursor(mDisplay,mWindow);
 
  if ( fullscreen ) vo_x11_decoration( mDisplay,mWindow,0 );
 
--- a/libvo/vo_xv.c	Thu Apr 12 23:23:29 2001 +0000
+++ b/libvo/vo_xv.c	Fri Apr 13 00:54:05 2001 +0000
@@ -138,6 +138,7 @@
  mywindow = XCreateWindow(mydisplay, RootWindow(mydisplay,screen),
  hint.x, hint.y, hint.width, hint.height,
  0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa);
+ vo_hidecursor(mydisplay,mywindow);
 
  XSelectInput(mydisplay, mywindow, StructureNotifyMask | KeyPressMask );
  XSetStandardProperties(mydisplay, mywindow, hello, hello, None, NULL, 0, &hint);
--- a/libvo/x11_common.c	Thu Apr 12 23:23:29 2001 +0000
+++ b/libvo/x11_common.c	Fri Apr 13 00:54:05 2001 +0000
@@ -24,6 +24,23 @@
 static int dpms_disabled=0;
 static int timeout_save=0;
 
+
+void vo_hidecursor ( Display *disp , Window win )
+{
+	Cursor no_ptr;
+	Pixmap bm_no;
+	XColor black,dummy;
+	Colormap colormap;
+	static unsigned char bm_no_data[] = { 0,0,0,0, 0,0,0,0  };
+	
+	colormap = DefaultColormap(disp,DefaultScreen(disp));
+	XAllocNamedColor(disp,colormap,"black",&black,&dummy);	
+	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);
+}
+
+
 int vo_init( void )
 {
  int       CompletionType = -1;
--- a/libvo/x11_common.h	Thu Apr 12 23:23:29 2001 +0000
+++ b/libvo/x11_common.h	Fri Apr 13 00:54:05 2001 +0000
@@ -9,6 +9,7 @@
 extern int vo_dheight;
 
 int vo_init( void );
+int vo_hidecursor ( Display* , Window );
 void vo_x11_decoration( Display * vo_Display,Window w,int d );
 int vo_x11_check_events(Display *mydisplay);
 #endif