changeset 36925:f0dd7b34f56e

Don't unnecessarily create a (void) cursor. Create it only if it hasn't already be done. This also prevents memory leaks and allows multiple calls (having no effect then).
author ib
date Wed, 19 Mar 2014 13:54:54 +0000
parents 5e22164b4b82
children f28f084fa78c
files gui/wm/ws.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gui/wm/ws.c	Tue Mar 18 23:18:02 2014 +0000
+++ b/gui/wm/ws.c	Wed Mar 19 13:54:54 2014 +0000
@@ -1442,8 +1442,11 @@
 
     case wsHideMouseCursor:
 
+        if (win->wsCursor == None) {
         win->wsCursor = XCreatePixmapCursor(wsDisplay, win->wsCursorPixmap, win->wsCursorPixmap, &win->wsColor, &win->wsColor, 0, 0);
         XDefineCursor(wsDisplay, win->WindowID, win->wsCursor);
+        }
+
         break;
     }
 }