[client,x11] fix right control ungrab

ungrab keybaord/mouse on first right control press. Fixes #9959
This commit is contained in:
akallabeth
2024-03-11 08:58:59 +01:00
committed by akallabeth
parent 552428ca53
commit c87368310a
2 changed files with 4 additions and 4 deletions

View File

@@ -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;

View File

@@ -277,7 +277,7 @@ struct xf_context
button_map button_map[NUM_BUTTONS_MAPPED];
BYTE savedMaximizedState;
UINT32 locked;
BOOL firstPressRightCtrl;
BOOL wasRightCtrlAlreadyPressed;
BOOL ungrabKeyboardWithRightCtrl;
#if defined(WITH_XI)