Skip to content

Commit

Permalink
#2560 validate keycodes before calling XTest
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@25059 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jan 23, 2020
1 parent 33b98a4 commit 0ea0972
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/xpra/x11/x11_server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def clear_keys_pressed(self):
keylog("clearing keys pressed: %s", self.keys_pressed)
with xsync:
for keycode in self.keys_pressed:
X11Keyboard.xtest_fake_key(keycode, False)
self.fake_key(keycode, False)
self.keys_pressed = {}
#this will take care of any remaining ones we are not aware of:
#(there should not be any - but we want to be certain)
Expand Down Expand Up @@ -792,6 +792,9 @@ def X11_ungrab(self):

def fake_key(self, keycode, press):
keylog("fake_key(%s, %s)", keycode, press)
mink, maxk = X11Keyboard.get_minmax_keycodes()
if keycode<mink or keycode>maxk:
return
with xsync:
X11Keyboard.xtest_fake_key(keycode, press)

Expand Down

0 comments on commit 0ea0972

Please sign in to comment.