[client] wm/wayland: correctly handle double keyboard grab

When input:grabKeyboardOnFocus is set (default), entering capture mode grabs
the keyboard a second time. This commit makes the second grab a no-op on
Wayland to avoid a crash.
This commit is contained in:
Quantum 2021-01-12 23:47:00 -05:00 committed by Geoffrey McRae
parent c650690bcc
commit 50c934db5a

View File

@ -460,7 +460,7 @@ static void wmWaylandGrabKeyboard()
{
struct WMDataWayland * wm = g_wmState.opaque;
if (wm->keyboardInhibitManager)
if (wm->keyboardInhibitManager && !wm->keyboardInhibitor)
{
wm->keyboardInhibitor = zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts(
wm->keyboardInhibitManager, wm->surface, wm->seat);