From 61a75ef8249ab86ef3e61f7081b15b382e216bbb Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 15 Sep 2017 14:23:34 +0200 Subject: [PATCH] Only select XFixes event once We never un-select it, and it's not a problem if we get extra ones so register it once right away. --- unix/x0vncserver/x0vncserver.cxx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index d3042db0..b844a534 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -163,8 +163,8 @@ public: XDesktop(Display* dpy_, Geometry *geometry_) : dpy(dpy_), geometry(geometry_), pb(0), server(0), oldButtonMask(0), haveXtest(false), haveDamage(false), - haveXfixes(false), maxButtons(0), running(false), - ledMasks(), ledState(0), codeMap(0), codeMapLen(0) + maxButtons(0), running(false), ledMasks(), ledState(0), + codeMap(0), codeMapLen(0) { int major, minor; @@ -257,7 +257,8 @@ public: int xfixesErrorBase; if (XFixesQueryExtension(dpy, &xfixesEventBase, &xfixesErrorBase)) { - haveXfixes = true; + XFixesSelectCursorInput(dpy, DefaultRootWindow(dpy), + XFixesDisplayCursorNotifyMask); } else { #endif vlog.info("XFIXES extension not present"); @@ -305,13 +306,6 @@ public: } #endif -#ifdef HAVE_XFIXES - if (haveXfixes) { - XFixesSelectCursorInput(dpy, DefaultRootWindow(dpy), - XFixesDisplayCursorNotifyMask); - } -#endif - server->setLEDState(ledState); running = true; @@ -531,7 +525,6 @@ protected: int oldButtonMask; bool haveXtest; bool haveDamage; - bool haveXfixes; int maxButtons; std::map pressedKeys; bool running; -- 2.39.5