diff options
author | Adam Halim <adaha@cendio.se> | 2024-09-24 15:55:21 +0200 |
---|---|---|
committer | Adam Halim <adaha@cendio.se> | 2024-10-22 14:52:31 +0200 |
commit | 63327145959e26193682e2b691a6027e26c1ce16 (patch) | |
tree | 772dcd8cc872bf7da5482cfaee33639cee924db4 /unix/x0vncserver | |
parent | 2fe9dca45f7d0a519fef5053ba61e2db7c1ff2b1 (diff) | |
download | tigervnc-63327145959e26193682e2b691a6027e26c1ce16.tar.gz tigervnc-63327145959e26193682e2b691a6027e26c1ce16.zip |
Add server support for forward/back mouse buttons
This commit adds support for the pseudo-encoding ExtendedMouseButtons in
Xvnc and x0vncserver, which makes it possible to use to use the
back/forward mouse buttons.
This commit contains work originally done by
PixelSmith <manny33@frontbuffer.com>.
Diffstat (limited to 'unix/x0vncserver')
-rw-r--r-- | unix/x0vncserver/XDesktop.cxx | 8 | ||||
-rw-r--r-- | unix/x0vncserver/XDesktop.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index 29af059f..bf796452 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -242,9 +242,9 @@ void XDesktop::init(VNCServer* vs) void XDesktop::start() { // Determine actual number of buttons of the X pointer device. - unsigned char btnMap[8]; - int numButtons = XGetPointerMapping(dpy, btnMap, 8); - maxButtons = (numButtons > 8) ? 8 : numButtons; + unsigned char btnMap[9]; + int numButtons = XGetPointerMapping(dpy, btnMap, 9); + maxButtons = (numButtons > 9) ? 9 : numButtons; vlog.info("Enabling %d button%s of X pointer device", maxButtons, (maxButtons != 1) ? "s" : ""); @@ -342,7 +342,7 @@ void XDesktop::queryConnection(network::Socket* sock, queryConnectDialog->map(); } -void XDesktop::pointerEvent(const Point& pos, uint8_t buttonMask) { +void XDesktop::pointerEvent(const Point& pos, uint16_t buttonMask) { #ifdef HAVE_XTEST if (!haveXtest) return; XTestFakeMotionEvent(dpy, DefaultScreen(dpy), diff --git a/unix/x0vncserver/XDesktop.h b/unix/x0vncserver/XDesktop.h index cf374fb9..711d6893 100644 --- a/unix/x0vncserver/XDesktop.h +++ b/unix/x0vncserver/XDesktop.h @@ -60,7 +60,7 @@ public: bool isRunning(); void queryConnection(network::Socket* sock, const char* userName) override; - void pointerEvent(const rfb::Point& pos, uint8_t buttonMask) override; + void pointerEvent(const rfb::Point& pos, uint16_t buttonMask) override; void keyEvent(uint32_t keysym, uint32_t xtcode, bool down) override; unsigned int setScreenLayout(int fb_width, int fb_height, const rfb::ScreenSet& layout) override; @@ -79,7 +79,7 @@ protected: rfb::VNCServer* server; QueryConnectDialog* queryConnectDialog; network::Socket* queryConnectSock; - uint8_t oldButtonMask; + uint16_t oldButtonMask; bool haveXtest; bool haveDamage; int maxButtons; |