feat(xkb): remember and restore keyboard layout per window - #2691
Open
6insanes wants to merge 1 commit into
Open
feat(xkb): remember and restore keyboard layout per window#26916insanes wants to merge 1 commit into
6insanes wants to merge 1 commit into
Conversation
Author
|
FYI for maintainers: the settings-side UI (a toggle for this in |
Adds an opt-in per_window_layout flag to XkbConfig. When enabled, the active xkb layout group is saved to the outgoing focus target and restored for the incoming one on every keyboard focus change, so each window keeps its own layout instead of sharing one global layout across the whole session. This change was implemented by Claude Code (Anthropic), directed, reviewed, and tested by the author. Closes pop-os/cosmic-epoch#3092
6insanes
force-pushed
the
per-window-keyboard-layout
branch
from
August 2, 2026 14:39
3ac6871 to
cddb5b8
Compare
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.
Adds an opt-in
per_window_layoutflag toXkbConfig. When enabled, the active xkb layout group is saved for the window losing keyboard focus and restored for the window gaining it, so each window keeps its own layout instead of sharing one global layout across the whole session — matching GNOME's "Use different sources for different windows".Behavior
Element/Fullscreenfocus targets). Popups, layer-shell surfaces (panel/dock), the window-group focus target, and the lock screen are intentionally excluded, so opening a context menu or tooltip never touches the layout.zcosmic_keyboard_layout_v1protocol and panel indicator need no changes — they already broadcast whatever the seat's active layout is, which this PR keeps in sync with the focused window.Testing
Manually tested on real hardware (KMS session on a spare VT, and now daily-driven in a real session) with 2 layouts (en/ru) and Alt+Shift switching: opening/switching between multiple windows correctly saves and restores each window's own layout.
Closes pop-os/cosmic-epoch#3092.
Related: pop-os/cosmic-settings#1038 (UI toggle) — companion PR for the settings checkbox will follow once this lands, since it needs this field to exist in a published
cosmic-comp-configrevision.