Skip to content

Commit

Permalink
Fix for FreeRDP#540: ctrl-enter toggles fullscreen
Browse files Browse the repository at this point in the history
Clear xfi->pressed_keys when window loses focus.
This would prevent a held alt key from putting the app into fullscreen if the
users sends ctrl+enter when the app regains focus.
  • Loading branch information
pfmooney authored and Patrick Mooney committed Aug 2, 2012
1 parent 29a4b0b commit 7cf594a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions client/X11/xf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ static boolean xf_event_FocusOut(xfInfo* xfi, XEvent* event, boolean app)
if (event->xfocus.mode == NotifyWhileGrabbed)
XUngrabKeyboard(xfi->display, CurrentTime);

xf_kbd_clear(xfi);

if (app)
xf_rail_send_activate(xfi, event->xany.window, false);

Expand Down
7 changes: 6 additions & 1 deletion client/X11/xf_keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@

void xf_kbd_init(xfInfo* xfi)
{
memset(xfi->pressed_keys, 0, 256 * sizeof(boolean));
xf_kbd_clear(xfi);
xfi->keyboard_layout_id = xfi->instance->settings->kbd_layout;
xfi->keyboard_layout_id = freerdp_keyboard_init(xfi->keyboard_layout_id);
xfi->instance->settings->kbd_layout = xfi->keyboard_layout_id;
}

void xf_kbd_clear(xfInfo* xfi)
{
memset(xfi->pressed_keys, 0, 256 * sizeof(boolean));
}

void xf_kbd_set_keypress(xfInfo* xfi, uint8 keycode, KeySym keysym)
{
if (keycode >= 8)
Expand Down
1 change: 1 addition & 0 deletions client/X11/xf_keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "xfreerdp.h"

void xf_kbd_init(xfInfo* xfi);
void xf_kbd_clear(xfInfo* xfi);
void xf_kbd_set_keypress(xfInfo* xfi, uint8 keycode, KeySym keysym);
void xf_kbd_unset_keypress(xfInfo* xfi, uint8 keycode);
void xf_kbd_release_all_keypress(xfInfo* xfi);
Expand Down

0 comments on commit 7cf594a

Please sign in to comment.