Fix for #540: ctrl-enter toggles fullscreen

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.
This commit is contained in:
Patrick Mooney 2012-08-02 15:45:03 -05:00 committed by Patrick Mooney
parent 29a4b0b45a
commit 7cf594a95f
3 changed files with 9 additions and 1 deletions

View File

@ -386,6 +386,8 @@ static boolean xf_event_FocusOut(xfInfo* xfi, XEvent* event, boolean app)
if (event->xfocus.mode == NotifyWhileGrabbed) if (event->xfocus.mode == NotifyWhileGrabbed)
XUngrabKeyboard(xfi->display, CurrentTime); XUngrabKeyboard(xfi->display, CurrentTime);
xf_kbd_clear(xfi);
if (app) if (app)
xf_rail_send_activate(xfi, event->xany.window, false); xf_rail_send_activate(xfi, event->xany.window, false);

View File

@ -28,12 +28,17 @@
void xf_kbd_init(xfInfo* xfi) 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 = xfi->instance->settings->kbd_layout;
xfi->keyboard_layout_id = freerdp_keyboard_init(xfi->keyboard_layout_id); xfi->keyboard_layout_id = freerdp_keyboard_init(xfi->keyboard_layout_id);
xfi->instance->settings->kbd_layout = 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) void xf_kbd_set_keypress(xfInfo* xfi, uint8 keycode, KeySym keysym)
{ {
if (keycode >= 8) if (keycode >= 8)

View File

@ -25,6 +25,7 @@
#include "xfreerdp.h" #include "xfreerdp.h"
void xf_kbd_init(xfInfo* xfi); 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_set_keypress(xfInfo* xfi, uint8 keycode, KeySym keysym);
void xf_kbd_unset_keypress(xfInfo* xfi, uint8 keycode); void xf_kbd_unset_keypress(xfInfo* xfi, uint8 keycode);
void xf_kbd_release_all_keypress(xfInfo* xfi); void xf_kbd_release_all_keypress(xfInfo* xfi);