Skip to content

Commit b0c6e1f

Browse files
FizmatikYuriy Tolpygoclaude
authored
keyboardManager: don't append locale layout if already present (#13616)
* keyboardManager: don't append locale layout if already present _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. * Rename variable to alreadyIncluded for clarity Address code review feedback: rename `dominated` to `alreadyIncluded` for better self-description of the boolean's purpose. Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Yuriy Tolpygo <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
1 parent 5304a85 commit b0c6e1f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

js/ui/keyboardManager.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ var KeyboardManager = class {
160160
}
161161

162162
_buildGroupStrings(_group) {
163-
let group = _group.concat(this._localeLayoutInfo);
163+
let alreadyIncluded = _group.some(g => g.layout === this._localeLayoutInfo.layout &&
164+
g.variant === this._localeLayoutInfo.variant);
165+
let group = alreadyIncluded ? _group : _group.concat(this._localeLayoutInfo);
164166
let layouts = group.map(g => g.layout).join(',');
165167
let variants = group.map(g => g.variant).join(',');
166168
return [layouts, variants];

0 commit comments

Comments
 (0)