Set the correct cursor when starting
XFixes only reports cursor changes. We must manually call
XFixesGetCursorImage() when starting.
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx
index c60d081..e670a0b 100644
--- a/unix/x0vncserver/XDesktop.cxx
+++ b/unix/x0vncserver/XDesktop.cxx
@@ -207,6 +207,10 @@
}
#endif
+#ifdef HAVE_XFIXES
+ setCursor();
+#endif
+
server->setLEDState(ledState);
running = true;
@@ -357,7 +361,6 @@
#ifdef HAVE_XFIXES
} else if (ev->type == xfixesEventBase + XFixesCursorNotify) {
XFixesCursorNotifyEvent* cev;
- XFixesCursorImage *cim;
if (!running)
return true;
@@ -367,6 +370,17 @@
if (cev->subtype != XFixesDisplayCursorNotify)
return false;
+ return setCursor();
+#endif
+ }
+
+ return false;
+}
+
+bool XDesktop::setCursor()
+{
+ XFixesCursorImage *cim;
+
cim = XFixesGetCursorImage(dpy);
if (cim == NULL)
return false;
@@ -410,9 +424,4 @@
delete [] cursorData;
XFree(cim);
return true;
-#endif
- }
-
- return false;
}
-
diff --git a/unix/x0vncserver/XDesktop.h b/unix/x0vncserver/XDesktop.h
index cc513a0..bc0648c 100644
--- a/unix/x0vncserver/XDesktop.h
+++ b/unix/x0vncserver/XDesktop.h
@@ -74,6 +74,7 @@
unsigned ledState;
const unsigned short *codeMap;
unsigned codeMapLen;
+ bool setCursor();
};
#endif // __XDESKTOP_H__