From 50c934db5a798dc43127670718f0f4b1bae253ca Mon Sep 17 00:00:00 2001 From: Quantum Date: Tue, 12 Jan 2021 23:47:00 -0500 Subject: [PATCH] [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. --- client/src/wm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/wm.c b/client/src/wm.c index 8d95f59d..e05029c4 100644 --- a/client/src/wm.c +++ b/client/src/wm.c @@ -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);