Blame SOURCES/release-keys-when-xfreerdp-is-unfocused-to-prevent-s.patch

56112c
From 1d12ad20cbd07b0aeb49ac9544de451c9f43f04c Mon Sep 17 00:00:00 2001
56112c
From: Seray Rosh <seray.rosh@web.de>
56112c
Date: Fri, 27 Feb 2015 16:02:40 +0100
56112c
Subject: [PATCH 2/2] release keys when xfreerdp is unfocused to prevent stuck
56112c
 keys
56112c
56112c
https://github.com/FreeRDP/FreeRDP/issues/2104
56112c
https://github.com/FreeRDP/FreeRDP/pull/2430
56112c
56112c
Backported by Ondrej Holy <oholy@redhat.com>.
56112c
---
56112c
 client/X11/xf_event.c    | 2 ++
56112c
 client/X11/xf_keyboard.c | 5 +++++
56112c
 2 files changed, 7 insertions(+)
56112c
56112c
diff --git a/client/X11/xf_event.c b/client/X11/xf_event.c
56112c
index cbcfc65..1475214 100644
56112c
--- a/client/X11/xf_event.c
56112c
+++ b/client/X11/xf_event.c
56112c
@@ -356,6 +356,8 @@ boolean xf_event_FocusOut(xfInfo* xfi, XEvent* event, boolean app)
56112c
 	if (event->xfocus.mode == NotifyWhileGrabbed)
56112c
 		XUngrabKeyboard(xfi->display, CurrentTime);
56112c
 
56112c
+	xf_kbd_release_all_keypress(xfi);
56112c
+
56112c
 	if (app)
56112c
 		xf_rail_send_activate(xfi, event->xany.window, false);
56112c
 
56112c
diff --git a/client/X11/xf_keyboard.c b/client/X11/xf_keyboard.c
56112c
index e94b362..fb14015 100644
56112c
--- a/client/X11/xf_keyboard.c
56112c
+++ b/client/X11/xf_keyboard.c
56112c
@@ -63,6 +63,11 @@ void xf_kbd_release_all_keypress(xfInfo* xfi)
56112c
 		{
56112c
 			rdp_scancode = freerdp_kbd_get_scancode_by_keycode(keycode, &extended);
56112c
 
56112c
+			// release tab before releasing the windows key.
56112c
+			// this stops the start menu from opening on unfocus event.
56112c
+			if (rdp_scancode == 0x5B && extended) /* Left Windows Key */
56112c
+				xfi->instance->input->KeyboardEvent(xfi->instance->input, KBD_FLAGS_RELEASE, 0x0F); /* Tab up */
56112c
+
56112c
 			flags = KBD_FLAGS_RELEASE;
56112c
 			flags |= (extended) ? KBD_FLAGS_EXTENDED : 0;
56112c
 			xfi->instance->input->KeyboardEvent(xfi->instance->input, flags, rdp_scancode);
56112c
-- 
56112c
2.9.3
56112c