From 8472474332aabe78021d4bf9b9f5f633d97883d2 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Mon, 17 Aug 2026 21:22:36 +0900 Subject: [PATCH] wl: modmask's caller has already looked at the keymap grabkey returns before it asks for the mask when there is no keyboard state, so the guard inside modmask answered a question nobody put to it -- except the test, which was the only caller that could reach it. A check kept alive by the test that reaches it is one line of code and one line of test to delete. Co-Authored-By: Claude Opus 5 (1M context) --- tests/wl_adapter_test.c | 2 -- wl.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/tests/wl_adapter_test.c b/tests/wl_adapter_test.c index 275b37a..810cc48 100644 --- a/tests/wl_adapter_test.c +++ b/tests/wl_adapter_test.c @@ -40,8 +40,6 @@ wl_modifier_mask(struct ct *t) struct xkb_keymap *km; xkb_mod_mask_t caps, ctrl, shift; - kstate = nil; - CT_EQ_UINT(t, 0, modmask()); /* before any keymap arrives */ ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS); km = xkb_keymap_new_from_string(ctx, keymaptext, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS); diff --git a/wl.c b/wl.c index 9f91def..f087504 100644 --- a/wl.c +++ b/wl.c @@ -126,8 +126,6 @@ modmask(void) int i; m = 0; - if(kstate == nil) - return m; for(i = 0; i < nelem(name); i++) if(xkb_state_mod_name_is_active(kstate, name[i], XKB_STATE_MODS_EFFECTIVE) > 0)