Implement hiding of mouse cursor on linux.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5007 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2010-02-04 04:49:29 +00:00
parent 090d7ec534
commit 6e2104b050
1 changed files with 13 additions and 0 deletions

View File

@ -400,6 +400,18 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
"GPU", None, NULL, 0, NULL); "GPU", None, NULL, 0, NULL);
XMapRaised(GLWin.dpy, GLWin.win); XMapRaised(GLWin.dpy, GLWin.win);
} }
if (g_Config.bHideCursor)
{
// make a blank cursor
Pixmap Blank;
XColor DummyColor;
char ZeroData[1] = {0};
Cursor MouseCursor;
Blank = XCreateBitmapFromData (GLWin.dpy, GLWin.win, ZeroData, 1, 1);
MouseCursor = XCreatePixmapCursor(GLWin.dpy, Blank, Blank, &DummyColor, &DummyColor, 0, 0);
XFreePixmap (GLWin.dpy, Blank);
XDefineCursor (GLWin.dpy, GLWin.win, MouseCursor);
}
#endif #endif
return true; return true;
} }
@ -585,6 +597,7 @@ void OpenGL_Shutdown()
hDC = NULL; // Set DC To NULL hDC = NULL; // Set DC To NULL
} }
#elif defined(HAVE_X11) && HAVE_X11 #elif defined(HAVE_X11) && HAVE_X11
if (g_Config.bHideCursor) XUndefineCursor(GLWin.dpy, GLWin.win);
if (GLWin.ctx) if (GLWin.ctx)
{ {
if (!glXMakeCurrent(GLWin.dpy, None, NULL)) if (!glXMakeCurrent(GLWin.dpy, None, NULL))