diff --git a/src/config/preset.h b/src/config/preset.h index ef0894b..ecec292 100644 --- a/src/config/preset.h +++ b/src/config/preset.h @@ -123,6 +123,10 @@ static const struct xkb_rule_names xkb_fallback_rules = { .options = NULL, }; +static const struct xkb_rule_names xkb_default_rules = { + .options = NULL, +}; + struct xkb_rule_names xkb_rules = { /* can specify fields: rules, model, layout, variant, options */ /* example: diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index 6e29ca8..87babc3 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -865,7 +865,7 @@ int switch_keyboard_layout(const Arg *arg) { if (!check_keyboard_rules_validate(&rules)) { wlr_log(WLR_ERROR, "Keyboard rules validation failed, skipping layout reset"); - rules = xkb_fallback_rules; + rules = xkb_default_rules; } char *layout_buf = (char *)rules.layout; // 假设这是可修改的 diff --git a/src/mango.c b/src/mango.c index 7dbf001..dc459df 100644 --- a/src/mango.c +++ b/src/mango.c @@ -2377,7 +2377,7 @@ KeyboardGroup *createkeyboardgroup(void) { if (!check_keyboard_rules_validate(&rules)) { wlr_log(WLR_ERROR, "Keyboard rules validation failed, skipping layout reset"); - rules = xkb_fallback_rules; + rules = xkb_default_rules; } /* Prepare an XKB keymap and assign it to the keyboard group. */ @@ -4633,7 +4633,7 @@ void reset_keyboard_layout(void) { if (!check_keyboard_rules_validate(&rules)) { wlr_log(WLR_ERROR, "Keyboard rules validation failed, skipping layout reset"); - rules = xkb_fallback_rules; + rules = xkb_default_rules; } // Create context