mirror of https://github.com/mpv-player/mpv
Autohide X11 cursor
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@385 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
9daf9a82ba
commit
8b84635c64
|
@ -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),
|
mywindow = XCreateWindow(mydisplay, RootWindow(mydisplay,screen),
|
||||||
hint.x, hint.y, hint.width, hint.height, 4, vinfo->depth,CopyFromParent,vinfo->visual,xswamask,&xswa);
|
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 );
|
wsGLXContext=glXCreateContext( mydisplay,vinfo,NULL,True );
|
||||||
// XStoreName( wsDisplay,wsMyWin,wsSysName );
|
// XStoreName( wsDisplay,wsMyWin,wsSysName );
|
||||||
|
|
|
@ -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.x,hint.y,
|
||||||
hint.width,hint.height,
|
hint.width,hint.height,
|
||||||
xswa.border_pixel,depth,CopyFromParent,vinfo.visual,xswamask,&xswa );
|
xswa.border_pixel,depth,CopyFromParent,vinfo.visual,xswamask,&xswa );
|
||||||
|
vo_hidecursor(mDisplay,mywindow);
|
||||||
|
|
||||||
if ( fullscreen ) vo_x11_decoration( mDisplay,mywindow,0 );
|
if ( fullscreen ) vo_x11_decoration( mDisplay,mywindow,0 );
|
||||||
XSelectInput( mDisplay,mywindow,StructureNotifyMask );
|
XSelectInput( mDisplay,mywindow,StructureNotifyMask );
|
||||||
|
|
|
@ -244,6 +244,7 @@ static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_
|
||||||
mDepth,
|
mDepth,
|
||||||
InputOutput,
|
InputOutput,
|
||||||
vinfo.visual,xswamask,&xWAttribs );
|
vinfo.visual,xswamask,&xWAttribs );
|
||||||
|
vo_hidecursor(mDisplay,mWindow);
|
||||||
|
|
||||||
if ( fullscreen ) vo_x11_decoration( mDisplay,mWindow,0 );
|
if ( fullscreen ) vo_x11_decoration( mDisplay,mWindow,0 );
|
||||||
|
|
||||||
|
|
|
@ -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),
|
mywindow = XCreateWindow(mydisplay, RootWindow(mydisplay,screen),
|
||||||
hint.x, hint.y, hint.width, hint.height,
|
hint.x, hint.y, hint.width, hint.height,
|
||||||
0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa);
|
0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa);
|
||||||
|
vo_hidecursor(mydisplay,mywindow);
|
||||||
|
|
||||||
XSelectInput(mydisplay, mywindow, StructureNotifyMask | KeyPressMask );
|
XSelectInput(mydisplay, mywindow, StructureNotifyMask | KeyPressMask );
|
||||||
XSetStandardProperties(mydisplay, mywindow, hello, hello, None, NULL, 0, &hint);
|
XSetStandardProperties(mydisplay, mywindow, hello, hello, None, NULL, 0, &hint);
|
||||||
|
|
|
@ -24,6 +24,23 @@ int vo_dheight=0;
|
||||||
static int dpms_disabled=0;
|
static int dpms_disabled=0;
|
||||||
static int timeout_save=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 vo_init( void )
|
||||||
{
|
{
|
||||||
int CompletionType = -1;
|
int CompletionType = -1;
|
||||||
|
|
|
@ -9,6 +9,7 @@ extern int vo_dwidth;
|
||||||
extern int vo_dheight;
|
extern int vo_dheight;
|
||||||
|
|
||||||
int vo_init( void );
|
int vo_init( void );
|
||||||
|
int vo_hidecursor ( Display* , Window );
|
||||||
void vo_x11_decoration( Display * vo_Display,Window w,int d );
|
void vo_x11_decoration( Display * vo_Display,Window w,int d );
|
||||||
int vo_x11_check_events(Display *mydisplay);
|
int vo_x11_check_events(Display *mydisplay);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue