fix: re-apply xkb.file keymap in reset_keymap path#3558
Draft
mgabor3141 wants to merge 1 commit intoniri-wm:mainfrom
Draft
fix: re-apply xkb.file keymap in reset_keymap path#3558mgabor3141 wants to merge 1 commit intoniri-wm:mainfrom
mgabor3141 wants to merge 1 commit intoniri-wm:mainfrom
Conversation
When reset_keymap triggers (after a virtual keyboard event followed by a physical keyboard event), the keymap is recompiled from the user's config. However, to_xkb_config() does not include the `file` field, so file-based keymaps are silently replaced with default rules-based keymaps, losing all custom symbols and overrides. Fix by checking for xkb.file first and calling set_xkb_file() in the reset path, mirroring the config-reload logic. Also make set_xkb_file() pub(crate) so it can be called from input/mod.rs. Fixes niri-wm#3557
Member
|
We're deleting this code soon |
mgabor3141
pushed a commit
to mgabor3141/dots
that referenced
this pull request
Mar 5, 2026
Add reset-keymap-xkb-file.patch: the reset_keymap code path in input/mod.rs calls to_xkb_config() which drops the file field, silently replacing file-based keymaps with defaults. The patch checks for xkb.file first and calls set_xkb_file() directly. Also update numlock-xkb-file.patch to make set_xkb_file() pub(crate) so it can be called from input/mod.rs. Upstream: niri-wm/niri#3557 PR: niri-wm/niri#3558
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the
reset_keymappath described in #3557 (Bug 1).Problem
When
reset_keymaptriggers (after a Wayland virtual keyboard event followed by a physical keyboard event), the keymap is recompiled viato_xkb_config(). However,to_xkb_config()does not include thefilefield — it only forwardsrules,model,layout,variant, andoptions. This silently replaces file-based keymaps with default rules-based keymaps, losing all custom symbols and overrides.Fix
Check for
xkb.filefirst in thereset_keymappath and callset_xkb_file()directly, mirroring how the config-reload logic handles file-based keymaps.Also makes
set_xkb_file()pub(crate)so it can be called frominput/mod.rs.Changes
src/input/mod.rs: In thereset_keymapblock, prioritizexkb.fileoverto_xkb_config()src/niri.rs: Changeset_xkb_filevisibility from private topub(crate)Note
Issue #3557 also describes a second bug (config reload fallback permanently poisoning the keymap when
set_xkb_filefails transiently). That is not addressed by this PR.