Browse Source

Set the correct cursor when starting

XFixes only reports cursor changes. We must manually call
XFixesGetCursorImage() when starting.
tags/v1.8.90
Peter Åstrand (astrand) 6 years ago
parent
commit
3abc7d4492
2 changed files with 16 additions and 6 deletions
  1. 15
    6
      unix/x0vncserver/XDesktop.cxx
  2. 1
    0
      unix/x0vncserver/XDesktop.h

+ 15
- 6
unix/x0vncserver/XDesktop.cxx View File

@@ -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;
}


+ 1
- 0
unix/x0vncserver/XDesktop.h View File

@@ -74,6 +74,7 @@ protected:
unsigned ledState;
const unsigned short *codeMap;
unsigned codeMapLen;
bool setCursor();
};

#endif // __XDESKTOP_H__

Loading…
Cancel
Save