diff options
author | Pierre Ossman <ossman@cendio.se> | 2023-02-09 11:30:37 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-02-09 11:30:37 +0100 |
commit | 1e3484f2017f038dd5149cd50741feaf39a680e4 (patch) | |
tree | 1abcbdc331499323c0fa74ed4a2a07cca361869f /unix/x0vncserver | |
parent | 4895f53aef52f878a1176f6e4f0f2992553d560c (diff) | |
download | tigervnc-1e3484f2017f038dd5149cd50741feaf39a680e4.tar.gz tigervnc-1e3484f2017f038dd5149cd50741feaf39a680e4.zip |
Sanity check when cleaning up keymap changes
Make sure we don't send a bogus request to the X server in the (common)
case that we don't actually have anything to restore.
Diffstat (limited to 'unix/x0vncserver')
-rw-r--r-- | unix/x0vncserver/XDesktop.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index 5f5366b7..19517929 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -481,6 +481,10 @@ void XDesktop::deleteAddedKeysyms(Display* dpy) { } } + // Did we actually find something to remove? + if (highestKeyCode < lowestKeyCode) + return; + changes.changed |= XkbKeySymsMask; changes.first_key_sym = lowestKeyCode; changes.num_key_syms = highestKeyCode - lowestKeyCode + 1; |