FIX: keyboard layout switching while search is focused (#13428)#13473
Open
carsteneu wants to merge 2 commits intolinuxmint:masterfrom
Open
FIX: keyboard layout switching while search is focused (#13428)#13473carsteneu wants to merge 2 commits intolinuxmint:masterfrom
carsteneu wants to merge 2 commits intolinuxmint:masterfrom
Conversation
…t#13428) Previously, when the menu search entry was focused, keyboard layout switching via keybindings (e.g., Alt+Shift, Super+Space) would not work. The key event was stopped but the keybinding callback was never invoked. This fix: - Invokes the keybinding callback before stopping event propagation - Allows modifier-only keys to propagate for XKB-based layout switching
Extends PR linuxmint#13473 to fix keyboard layout switching (Alt+Shift, etc.) across all Cinnamon text input fields, not just the menu search. Components fixed: - Menu search field (refactored to use helper) - Alt+F2 run dialog - Expo workspace renaming - Polkit authentication dialog (sudo passwords) - Network password dialog (WiFi/VPN) - Keyring password prompt Technical approach: - Created reusable handleKeyboardLayoutSwitchingInTextEntry() in util.js - Respects Input Methods (has_preedit check for CJK languages) - Handles custom keybindings (switch-input-source via KeybindingManager) - Allows modifier-only keys to propagate for XKB-based switching - Performance optimized (Set lookup instead of OR-chain) - Extended modifier list (Hyper, Meta keys) Root cause: - Commit 6a51054 (Dec 15) moved switch-input-source to KeybindingManager - Commit 05e68dd (Dec 12) blocked keybindings in text entries - Components must now invoke KeybindingManager explicitly Tested: - Linux Mint 22.3 Cinnamon 6.6.6 - US + DE layouts with Alt+Shift switching - All components verified working (Menu, Alt+F2, Expo, Polkit, Keyring) Fixes: linuxmint#13428, linuxmint#13513, linuxmint#13407
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.
Keyboard layout switching doesn't work when Cinnamon text fields are focused. Keybindings like Alt+Shift or Super+Space have no effect because text entry key event handlers stop event propagation.
Extended scope:
This fix now covers ALL (hopefully) Cinnamon text entries, not just the menu:
But please this should be double checked - these are system critical fields, i dont feel enough experienced to be shure i checked every possible caveat here.
The fix has two parts:
The Implementation
handleKeyboardLayoutSwitchingInTextEntry()inutil.jsThis should allow users to switch keyboard layouts while typing in any Cinnamon text field.
Root Cause in my point of view
switch-input-sourcefromglobal.displaytoKeybindingManagerTests done:
Tested on Linux Mint 22.3 Cinnamon 6.6.6 with US + DE layouts:
Fixes #13428, #13513, #13407