mirror of https://github.com/FreeRDP/FreeRDP
release keys when xfreerdp is unfocused to prevent stuck keys
This commit is contained in:
parent
ff6dbb049c
commit
ffa7f0363f
|
@ -545,6 +545,7 @@ static BOOL xf_event_FocusOut(xfContext* xfc, XEvent* event, BOOL app)
|
||||||
if (event->xfocus.mode == NotifyWhileGrabbed)
|
if (event->xfocus.mode == NotifyWhileGrabbed)
|
||||||
XUngrabKeyboard(xfc->display, CurrentTime);
|
XUngrabKeyboard(xfc->display, CurrentTime);
|
||||||
|
|
||||||
|
xf_keyboard_release_all_keypress(xfc);
|
||||||
xf_keyboard_clear(xfc);
|
xf_keyboard_clear(xfc);
|
||||||
|
|
||||||
if (app)
|
if (app)
|
||||||
|
|
|
@ -173,6 +173,12 @@ void xf_keyboard_release_all_keypress(xfContext* xfc)
|
||||||
if (xfc->KeyboardState[keycode] != NoSymbol)
|
if (xfc->KeyboardState[keycode] != NoSymbol)
|
||||||
{
|
{
|
||||||
rdp_scancode = freerdp_keyboard_get_rdp_scancode_from_x11_keycode(keycode);
|
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);
|
freerdp_input_send_keyboard_event_ex(xfc->instance->input, FALSE, rdp_scancode);
|
||||||
xfc->KeyboardState[keycode] = NoSymbol;
|
xfc->KeyboardState[keycode] = NoSymbol;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue