[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 authored and Geoffrey McRae committed 2021-02-09 20:06:27 +11:00
1 parent 637a7625d2
commit ec921d7f39
1 file changed
+1 -1
+1 -1
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();
}