[client] spice: correctly ungrab keyboard when grabKeyboardOnFocus=no

When input:grabKeyboardOnFocus=no, exiting capture mode should ungrab
the keyboard. Otherwise, focusing the window doesn't grab the keyboard,
but toggling capture mode would leave the keyboard stuck in a grabbed
state until defocused.
This commit is contained in:
Quantum 2021-01-31 21:39:44 -05:00 committed by Geoffrey McRae
parent 637a7625d2
commit ec921d7f39

View File

@ -1563,7 +1563,7 @@ static void setGrabQuiet(bool enable)
{
if (params.grabKeyboard)
{
if (!g_state.focused || params.captureInputOnly)
if (!params.grabKeyboardOnFocus || !g_state.focused || params.captureInputOnly)
g_state.ds->ungrabKeyboard();
}