From 41d38ee8fbb5302f87469d0b296ae8cb5438f703 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Thu, 13 May 1999 18:43:40 +0000 Subject: [PATCH] Fixed quite ill window locking code. --- windows/x11drv/mouse.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/windows/x11drv/mouse.c b/windows/x11drv/mouse.c index 3fcfa0e9f3c..e2af577318f 100644 --- a/windows/x11drv/mouse.c +++ b/windows/x11drv/mouse.c @@ -33,6 +33,7 @@ static BOOL X11DRV_MOUSE_DoSetCursor( CURSORICONINFO *ptr ) Pixmap pixmapBits, pixmapMask, pixmapAll; XColor fg, bg; Cursor cursor = None; + BOOL DesktopWinExists = FALSE; if (!ptr) /* Create an empty cursor */ { @@ -143,7 +144,12 @@ static BOOL X11DRV_MOUSE_DoSetCursor( CURSORICONINFO *ptr ) if (X11DRV_MOUSE_XCursor != None) XFreeCursor( display, X11DRV_MOUSE_XCursor ); X11DRV_MOUSE_XCursor = cursor; - if (X11DRV_GetXRootWindow() != DefaultRootWindow(display) || !WIN_GetDesktop()) + if (WIN_GetDesktop() != NULL) + { + DesktopWinExists = TRUE; + WIN_ReleaseDesktop(); + } + if (X11DRV_GetXRootWindow() != DefaultRootWindow(display) || !DesktopWinExists) { /* Set the cursor on the desktop window */ XDefineCursor( display, X11DRV_GetXRootWindow(), cursor ); @@ -164,7 +170,6 @@ static BOOL X11DRV_MOUSE_DoSetCursor( CURSORICONINFO *ptr ) WIN_ReleaseWndPtr(tmpWnd); } } - WIN_ReleaseDesktop(); return TRUE; }