aboutsummaryrefslogtreecommitdiffstats
path: root/unix/x0vncserver
diff options
context:
space:
mode:
authorPeter Åstrand (astrand) <astrand@cendio.se>2017-10-11 15:12:10 +0200
committerPeter Åstrand (astrand) <astrand@cendio.se>2017-11-08 10:40:13 +0100
commit3abc7d44920f72f4e9df45011347739ade4e17c4 (patch)
tree177fe2497f4423898b8b277c5ad7c2d5834dbd88 /unix/x0vncserver
parente2c3b60f32d63590fb17be5342586177b5e72147 (diff)
downloadtigervnc-3abc7d44920f72f4e9df45011347739ade4e17c4.tar.gz
tigervnc-3abc7d44920f72f4e9df45011347739ade4e17c4.zip
Set the correct cursor when starting
XFixes only reports cursor changes. We must manually call XFixesGetCursorImage() when starting.
Diffstat (limited to 'unix/x0vncserver')
-rw-r--r--unix/x0vncserver/XDesktop.cxx21
-rw-r--r--unix/x0vncserver/XDesktop.h1
2 files changed, 16 insertions, 6 deletions
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx
index c60d0813..e670a0b7 100644
--- a/unix/x0vncserver/XDesktop.cxx
+++ b/unix/x0vncserver/XDesktop.cxx
@@ -207,6 +207,10 @@ void XDesktop::start(VNCServer* vs) {
}
#endif
+#ifdef HAVE_XFIXES
+ setCursor();
+#endif
+
server->setLEDState(ledState);
running = true;
@@ -357,7 +361,6 @@ bool XDesktop::handleGlobalEvent(XEvent* ev) {
#ifdef HAVE_XFIXES
} else if (ev->type == xfixesEventBase + XFixesCursorNotify) {
XFixesCursorNotifyEvent* cev;
- XFixesCursorImage *cim;
if (!running)
return true;
@@ -367,6 +370,17 @@ bool XDesktop::handleGlobalEvent(XEvent* ev) {
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 @@ bool XDesktop::handleGlobalEvent(XEvent* ev) {
delete [] cursorData;
XFree(cim);
return true;
-#endif
- }
-
- return false;
}
-
diff --git a/unix/x0vncserver/XDesktop.h b/unix/x0vncserver/XDesktop.h
index cc513a03..bc0648c8 100644
--- a/unix/x0vncserver/XDesktop.h
+++ b/unix/x0vncserver/XDesktop.h
@@ -74,6 +74,7 @@ protected:
unsigned ledState;
const unsigned short *codeMap;
unsigned codeMapLen;
+ bool setCursor();
};
#endif // __XDESKTOP_H__