ecere/gui/drivers/XInterface: Fixed X errors caused by calling XDefineCursor on a...
authorJerome St-Louis <jerome@ecere.com>
Wed, 12 Feb 2014 03:00:36 +0000 (10:00 +0700)
committerJerome St-Louis <jerome@ecere.com>
Wed, 12 Feb 2014 03:00:36 +0000 (10:00 +0700)
ecere/src/gui/drivers/XInterface.ec

index 7c92fac..c7843de 100644 (file)
@@ -3007,8 +3007,9 @@ class XInterface : Interface
 
    void SetMouseCursor(Window window, int cursor)
    {
-      XDefineCursor(xGlobalDisplay, (X11Window) window.rootWindow.windowHandle,
-         cursor == -1 ? (X11Cursor)0 : systemCursors[(SystemCursor)cursor]);
+      if(window.rootWindow.windowHandle)
+         XDefineCursor(xGlobalDisplay, (X11Window) window.rootWindow.windowHandle,
+            cursor == -1 ? (X11Cursor)0 : systemCursors[(SystemCursor)cursor]);
    }
 
    // --- Caret ---