Skip to content

Conversation

@carsteneu
Copy link
Contributor

@carsteneu carsteneu commented Jan 22, 2026

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:

  • Menu search field
  • Alt+F2 run dialog
  • Expo workspace renaming
  • Polkit authentication dialog (sudo passwords)
  • Network password dialog (WiFi/VPN)
  • Keyring password prompt

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:

  1. For custom keybindings (like switch-input-source), invoke the keybinding callback before stopping event propagation
  2. For modifier-only keys (Alt, Shift, Ctrl, Super), allow the event to propagate so XKB-based layout switching can work

The Implementation

  • Created reusable helper function handleKeyboardLayoutSwitchingInTextEntry() in util.js
  • Respects Input Methods (has_preedit check for CJK languages)
  • Performance optimized (Set-based lookup)
  • Extended modifier list (Hyper, Meta keys)

This should allow users to switch keyboard layouts while typing in any Cinnamon text field.

Root Cause in my point of view

  • Commit 6a51054 (Dec 15) moved switch-input-source from global.display to KeybindingManager
  • Commit 05e68dd (Dec 12) blocked keybindings in text entries to prevent duplicate events
  • Components must now explicitly invoke KeybindingManager for layout switching

Tests done:

Tested on Linux Mint 22.3 Cinnamon 6.6.6 with US + DE layouts:

  • ✅ Menu search field
  • ✅ Alt+F2 run dialog
  • ✅ Expo workspace renaming
  • ✅ Polkit authentication (sudo)
  • ✅ Keyring prompt

Fixes #13428, #13513, #13407

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Regression] Keyboard layout switching latency (Alt+Shift) and failure to switch within Mint Menu search

1 participant