From 44879f5d3f674628635ecb4ddfcacaed46b65355 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Nov 2010 21:17:32 +0100 Subject: [PATCH] Changed: #1034 Implement CCustomMouse for Linux --- .../3d/driver/opengl/driver_opengl_inputs.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp index 5d577a025..2300333c6 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp @@ -269,14 +269,17 @@ void CDriverGL::createCursors() #elif defined(NL_OS_UNIX) _DefaultCursor = None; - // create blank cursor - char bm_no_data[] = { 0,0,0,0,0,0,0,0 }; - Pixmap pixmap_no_data = XCreateBitmapFromData (_dpy, _win, bm_no_data, 8, 8); - XColor black; - memset(&black, 0, sizeof (XColor)); - black.flags = DoRed | DoGreen | DoBlue; - _BlankCursor = XCreatePixmapCursor (_dpy, pixmap_no_data, pixmap_no_data, &black, &black, 0, 0); - XFreePixmap(_dpy, pixmap_no_data); + if (_dpy && _win && _BlankCursor == EmptyCursor) + { + // create blank cursor + char bm_no_data[] = { 0,0,0,0,0,0,0,0 }; + Pixmap pixmap_no_data = XCreateBitmapFromData (_dpy, _win, bm_no_data, 8, 8); + XColor black; + memset(&black, 0, sizeof (XColor)); + black.flags = DoRed | DoGreen | DoBlue; + _BlankCursor = XCreatePixmapCursor (_dpy, pixmap_no_data, pixmap_no_data, &black, &black, 0, 0); + XFreePixmap(_dpy, pixmap_no_data); + } #endif }