[Spice-devel] [spice-gtk] Don't attempt to send 0 scancode when releasing keys
Christophe Fergeau
cfergeau at redhat.com
Fri Feb 7 05:44:33 PST 2014
When releasing all keys, we send a key release for scancode in the
key_state array, including the very first element with scancode 0.
send_key() complain when the scancode is 0, so make sure we don't call it
for this first element.
This fixes a
(remote-viewer:25548): GSpice-CRITICAL **: send_key: assertion 'scancode != 0' failed
warning when starting remote-viewer windowed, and then switching to another
desktop client-side using ctrl+alt+arrow.
---
gtk/spice-widget.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 4e76648..f5adf66 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1255,7 +1255,10 @@ static void release_keys(SpiceDisplay *display)
continue;
}
for (b = 0; b < 32; b++) {
- send_key(display, i * 32 + b, SEND_KEY_RELEASE, FALSE);
+ unsigned int scancode = i * 32 + b;
+ if (scancode != 0) {
+ send_key(display, scancode, SEND_KEY_RELEASE, FALSE);
+ }
}
}
}
--
1.8.5.3
More information about the Spice-devel
mailing list