From 8b84635c64500dc48ba1785710e0168bd4a1d51f Mon Sep 17 00:00:00 2001 From: lgb Date: Fri, 13 Apr 2001 00:54:05 +0000 Subject: Autohide X11 cursor git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@385 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 1 + libvo/vo_x11.c | 1 + libvo/vo_xmga.c | 1 + libvo/vo_xv.c | 1 + libvo/x11_common.c | 17 +++++++++++++++++ libvo/x11_common.h | 1 + 6 files changed, 22 insertions(+) (limited to 'libvo') diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 21bbb41e65..8d3e23ad22 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -183,6 +183,7 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 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 ); diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index 8cb85fd6bb..a8f26d9cfb 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -225,6 +225,7 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d 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 ); diff --git a/libvo/vo_xmga.c b/libvo/vo_xmga.c index 77e77fbc2b..0d995cad4c 100644 --- a/libvo/vo_xmga.c +++ b/libvo/vo_xmga.c @@ -244,6 +244,7 @@ static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_ mDepth, InputOutput, vinfo.visual,xswamask,&xWAttribs ); + vo_hidecursor(mDisplay,mWindow); if ( fullscreen ) vo_x11_decoration( mDisplay,mWindow,0 ); diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index e6a35567d9..422ef6f06a 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -138,6 +138,7 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t 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); diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 765ad7e237..9402e97e19 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -24,6 +24,23 @@ int vo_dheight=0; 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; diff --git a/libvo/x11_common.h b/libvo/x11_common.h index 8ef96f6b24..496f9162a9 100644 --- a/libvo/x11_common.h +++ b/libvo/x11_common.h @@ -9,6 +9,7 @@ extern int vo_dwidth; 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 -- cgit v1.2.3