>From ffa7f0363fa4f0770d0f1ac451d7a5e87d415d7b Mon Sep 17 00:00:00 2001 From: Seray Rosh Date: Fri, 27 Feb 2015 16:02:40 +0100 Subject: [PATCH] fix #778650: release keys when xfreerdp is unfocused to prevent stuck keys This fixes https://bugs.debian.org/778650 Originated from https://github.com/FreeRDP/FreeRDP/pull/2430 Cherry picked from upstream commit ffa7f0363fa4f0770d0f1ac451d7a5e87d415d7b, ported for debian/1.1.0~git20140921.1.440916e+dfsg1-5 --- Signed-off-by: Petr Vorel --- client/X11/xf_event.c | 1 + client/X11/xf_keyboard.c | 6 ++++++ 2 files changed, 7 insertions(+) --- a/client/X11/xf_event.c +++ b/client/X11/xf_event.c @@ -456,6 +456,7 @@ if (event->xfocus.mode == NotifyWhileGrabbed) XUngrabKeyboard(xfc->display, CurrentTime); + xf_kbd_release_all_keypress(xfc); xf_kbd_clear(xfc); if (app) --- a/client/X11/xf_keyboard.c +++ b/client/X11/xf_keyboard.c @@ -75,6 +75,12 @@ if (xfc->pressed_keys[keycode] != NoSymbol) { rdp_scancode = freerdp_keyboard_get_rdp_scancode_from_x11_keycode(keycode); + + // release tab before releasing the windows key. + // this stops the start menu from opening on unfocus event. + if (rdp_scancode == RDP_SCANCODE_LWIN) + freerdp_input_send_keyboard_event_ex(xfc->instance->input, FALSE, RDP_SCANCODE_TAB); + freerdp_input_send_keyboard_event_ex(xfc->instance->input, FALSE, rdp_scancode); xfc->pressed_keys[keycode] = NoSymbol; }