diff options
Diffstat (limited to 'client/X11/xf_keyboard.c')
-rw-r--r-- | client/X11/xf_keyboard.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/client/X11/xf_keyboard.c b/client/X11/xf_keyboard.c index 9b575c2..cfbd6ca 100644 --- a/client/X11/xf_keyboard.c +++ b/client/X11/xf_keyboard.c @@ -120,7 +120,7 @@ static BOOL xf_keyboard_action_script_init(xfContext* xfc) char* context = NULL; strtok_s(buffer, "\n", &context); - if (!buffer || !ArrayList_Append(xfc->keyCombinations, buffer)) + if (!ArrayList_Append(xfc->keyCombinations, buffer)) { ArrayList_Free(xfc->keyCombinations); xfc->actionScriptExists = FALSE; @@ -180,7 +180,7 @@ void xf_keyboard_key_press(xfContext* xfc, const XKeyEvent* event, KeySym keysym WINPR_ASSERT(xfc); WINPR_ASSERT(event); - WINPR_ASSERT(event->keycode <= ARRAYSIZE(xfc->KeyboardState)); + WINPR_ASSERT(event->keycode < ARRAYSIZE(xfc->KeyboardState)); last = xfc->KeyboardState[event->keycode]; xfc->KeyboardState[event->keycode] = TRUE; @@ -195,7 +195,7 @@ void xf_keyboard_key_release(xfContext* xfc, const XKeyEvent* event, KeySym keys { WINPR_ASSERT(xfc); WINPR_ASSERT(event); - WINPR_ASSERT(event->keycode <= ARRAYSIZE(xfc->KeyboardState)); + WINPR_ASSERT(event->keycode < ARRAYSIZE(xfc->KeyboardState)); BOOL last = xfc->KeyboardState[event->keycode]; xfc->KeyboardState[event->keycode] = FALSE; @@ -555,11 +555,11 @@ BOOL xf_keyboard_handle_special_keys(xfContext* xfc, KeySym keysym) // do not return anything such that the key could be used by client if ungrab is not the goal if (keysym == XK_Control_R) { - if (mod.RightCtrl && xfc->firstPressRightCtrl) + if (mod.RightCtrl && !xfc->wasRightCtrlAlreadyPressed) { // Right Ctrl is pressed, getting ready to ungrab xfc->ungrabKeyboardWithRightCtrl = TRUE; - xfc->firstPressRightCtrl = FALSE; + xfc->wasRightCtrlAlreadyPressed = TRUE; } } else @@ -689,7 +689,7 @@ void xf_keyboard_handle_special_keys_release(xfContext* xfc, KeySym keysym) if (keysym != XK_Control_R) return; - xfc->firstPressRightCtrl = TRUE; + xfc->wasRightCtrlAlreadyPressed = FALSE; if (!xfc->ungrabKeyboardWithRightCtrl) return; |