Blame SOURCES/tigervnc-sanity-check-when-cleaning-up-keymap-changes.patch

3542a6
From 774c6bcf33b5c9b94c1ff12895775e77c555decc Mon Sep 17 00:00:00 2001
3542a6
From: Pierre Ossman <ossman@cendio.se>
3542a6
Date: Thu, 9 Feb 2023 11:30:37 +0100
3542a6
Subject: [PATCH] Sanity check when cleaning up keymap changes
3542a6
3542a6
Make sure we don't send a bogus request to the X server in the (common)
3542a6
case that we don't actually have anything to restore.
3542a6
3542a6
(cherry picked from commit 1e3484f2017f038dd5149cd50741feaf39a680e4)
3542a6
---
3542a6
 unix/x0vncserver/XDesktop.cxx | 4 ++++
3542a6
 1 file changed, 4 insertions(+)
3542a6
3542a6
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx
3542a6
index d5c6b2db9..f9c810968 100644
3542a6
--- a/unix/x0vncserver/XDesktop.cxx
3542a6
+++ b/unix/x0vncserver/XDesktop.cxx
3542a6
@@ -481,6 +481,10 @@ void XDesktop::deleteAddedKeysyms(Display* dpy) {
3542a6
     }
3542a6
   }
3542a6
3542a6
+  // Did we actually find something to remove?
3542a6
+  if (highestKeyCode < lowestKeyCode)
3542a6
+    return;
3542a6
+
3542a6
   changes.changed |= XkbKeySymsMask;
3542a6
   changes.first_key_sym = lowestKeyCode;
3542a6
   changes.num_key_syms = highestKeyCode - lowestKeyCode + 1;