Skip to content

Commit

Permalink
deskflow#4477 Only allow mouse buttons 1-10 for XTestFakeButtons call.
Browse files Browse the repository at this point in the history
These are the only valid ones:
[~]>for i in `seq 0 1 11`; do echo Testing $i; xte "mouseclick $i"; done
Testing 0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  132 (XTEST)
  Minor opcode of failed request:  2 (X_XTestFakeInput)
  Value in failed request:  0x0
  Serial number of failed request:  12
  Current serial number in output stream:  15
Testing 1
Testing 2
Testing 3
Testing 4
Testing 5
Testing 6
Testing 7
Testing 8
Testing 9
Testing 10
Testing 11
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  132 (XTEST)
  Minor opcode of failed request:  2 (X_XTestFakeInput)
  Value in failed request:  0xb
  Serial number of failed request:  12

And there are mice out there where buttons 11+ can be pressed accidentally,
terminating the synergy client and often leaving the system in a bad state.
  • Loading branch information
chrschmidt authored and Andrew Nelless committed Jan 25, 2017
1 parent f594427 commit 21d4e6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/platform/XWindowsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ void
XWindowsScreen::fakeMouseButton(ButtonID button, bool press)
{
const unsigned int xButton = mapButtonToX(button);
if (xButton != 0) {
if (xButton > 0 && xButton < 11) {
XTestFakeButtonEvent(m_display, xButton,
press ? True : False, CurrentTime);
XFlush(m_display);
Expand Down

0 comments on commit 21d4e6a

Please sign in to comment.