keyboardManager: don't append locale layout if already present#13616
Open
Fizmatik wants to merge 1 commit intolinuxmint:masterfrom
Open
keyboardManager: don't append locale layout if already present#13616Fizmatik wants to merge 1 commit intolinuxmint:masterfrom
Fizmatik wants to merge 1 commit intolinuxmint:masterfrom
Conversation
_buildGroupStrings() unconditionally appends the locale-derived layout to the XKB group. When the user's configured layouts already include the locale layout (e.g. 'ru' with ru_RU.UTF-8 locale), this produces duplicates like 'us,ru,ru', adding a phantom third layout to the switcher. Check whether the locale layout is already present before appending it.
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.
Problem
_buildGroupStrings()injs/ui/keyboardManager.jsunconditionally appends the locale-derived layout (from_getLocaleLayout()) to every XKB group via.concat(this._localeLayoutInfo).When the user's configured layouts already include the locale layout (e.g.
rulayout withru_RU.UTF-8locale), this produces duplicates —setxkbmapreportsus,ru,ruinstead ofus,ru, adding a phantom third layout to the switcher.This affects all users whose system locale matches one of their configured keyboard layouts (common for Russian, Ukrainian, German, French, and many other non-English locales).
Steps to reproduce
ru_RU.UTF-8(or any non-English locale)setxkbmap -queryExpected:
layout: us,ruActual:
layout: us,ru,ruFix
Check whether the locale layout is already present in the group before appending it. This preserves the original intent (ensuring a locale layout slot is always available for toolkit mnemonics) while avoiding duplication.
Testing
Tested on Linux Mint 22 Cinnamon (cinnamon 6.6.7, locale
ru_RU.UTF-8). After the fix,setxkbmap -querycorrectly reportsus,ruand the layout switcher shows exactly two layouts.