summaryrefslogtreecommitdiffstats
path: root/cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'cursor.c')
-rw-r--r--cursor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cursor.c b/cursor.c
index f04dc84..5663e85 100644
--- a/cursor.c
+++ b/cursor.c
@@ -452,7 +452,11 @@ void rfbPrintXCursor(rfbCursorPtr cursor)
extern void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c,Bool freeOld)
{
LOCK(rfbScreen->cursorMutex);
- rfbUndrawCursor(rfbScreen);
+ while(rfbScreen->cursorIsDrawn) {
+ UNLOCK(rfbScreen->cursorMutex);
+ rfbUndrawCursor(rfbScreen);
+ LOCK(rfbScreen->cursorMutex);
+ }
if(freeOld && rfbScreen->cursor)
rfbFreeCursor(rfbScreen->cursor);