[vinagre] Correctly handle extended scancodes for RDP
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vinagre] Correctly handle extended scancodes for RDP
- Date: Thu, 28 Jul 2016 14:16:59 +0000 (UTC)
commit 69acae5330c848cb7bf4094ebce34ccad798c6ca
Author: Michał Kępień <michal kepien nask pl>
Date: Thu Jul 28 15:12:20 2016 +0100
Correctly handle extended scancodes for RDP
Vinagre incorrectly handles extended RDP scancodes, which makes it
impossible to use some keys (e.g. both Super keys, right Alt, right
Control) in RDP sessions. When compiled against FreeRDP 1.0, the value
stored in frdp_event->extended is ignored, while an extended event's
flags should have the KDB_FLAGS_EXTENDED bit set. When compiled against
FreeRDP 1.1, the value returned by
freerdp_keyboard_get_rdp_scancode_from_x11_keycode() is incorrectly
stored verbatim into frdp_event->code as it contains both an extended
scancode indicator and the actual scancode.
https://bugzilla.gnome.org/show_bug.cgi?id=769025
plugins/rdp/vinagre-rdp-tab.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
index 476071c..b731f9b 100644
--- a/plugins/rdp/vinagre-rdp-tab.c
+++ b/plugins/rdp/vinagre-rdp-tab.c
@@ -705,17 +705,25 @@ frdp_key_pressed (GtkWidget *widget,
VinagreRdpTab *rdp_tab = (VinagreRdpTab *) user_data;
VinagreRdpTabPrivate *priv = rdp_tab->priv;
frdpEventKey *frdp_event;
+#if HAVE_FREERDP_1_1
+ UINT16 scancode;
+#endif
frdp_event = g_new0 (frdpEventKey, 1);
frdp_event->type = FRDP_EVENT_TYPE_KEY;
frdp_event->flags = event->type == GDK_KEY_PRESS ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE;
#if HAVE_FREERDP_1_1
- frdp_event->code = freerdp_keyboard_get_rdp_scancode_from_x11_keycode (event->hardware_keycode);
+ scancode = freerdp_keyboard_get_rdp_scancode_from_x11_keycode (event->hardware_keycode);
+ frdp_event->code = RDP_SCANCODE_CODE(scancode);
+ frdp_event->extended = RDP_SCANCODE_EXTENDED(scancode);
#else
frdp_event->code = freerdp_kbd_get_scancode_by_keycode (event->hardware_keycode, &frdp_event->extended);
#endif
+ if (frdp_event->extended)
+ frdp_event->flags |= KBD_FLAGS_EXTENDED;
+
g_queue_push_tail (priv->events, frdp_event);
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]