Make the interactive Browser honor configured keyboard layouts - #1851
Merged
Conversation
The private Browser Xvfb always started with the US XKB layout, so non-US keyboards could not type their printed characters in the interactive Browser window: German Mac users could not type "@" via Option+L, and umlauts, brackets, and AltGr/Option symbols landed on wrong keys or vanished. Add keyboard_layout / keyboard_variant Browser settings (validated as safe XKB tokens, empty keeps US behavior). Browser startup applies the layout to the private display with setxkbmap and pins it on the Xpra shadow server (--keyboard-sync=no, --keyboard-layout, --keyboard-variant) so connecting clients cannot override the server layout. Layout changes flow through browser_runtime_config and restart internal runtimes. The fallback canvas input path also stopped discarding Alt/AltGr combinations that produce printable characters, and the settings UI offers free-text layout/variant fields linking to the official xkeyboard-config list.
Only forward Alt-modified text from AltGraph or macOS Option input. Keep ordinary Windows and Linux Alt shortcuts from becoming literal characters, with focused regression coverage.
3clyp50
force-pushed
the
browser-keyboard-layout
branch
from
August 27, 2026 11:04
ffa76c0 to
efb8401
Compare
Contributor
|
Hi @Jehu, thank you for the contribution. I rebased the PR onto the current |
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.
The interactive Browser window always ran with a US XKB layout, so non-US keyboards could not type their printed characters: German Mac users could not type
@with Option+L, and umlauts, brackets, and AltGr symbols landed on wrong keys or vanished. The Browser now applies a configured XKB layout to its private display, so typed characters match the physical keyboard.What changed
keyboard_layout/keyboard_variant(e.g.de+mac). Values are normalized to safe XKB tokens; empty keeps the current US behavior. Layout changes flow throughbrowser_runtime_config, so saving a new layout restarts internal runtimes, matching the existing proxy-settings semantics.setxkbmapand pins it on the Xpra shadow server (--keyboard-sync=no,--keyboard-layout,--keyboard-variant), so connecting HTML5 clients cannot override the server layout.altKeyevent.Tests
pytest tests/test_browser_agent_regressions.py -q— 129 passed (config defaults, token normalization, restart semantics, Xpra arg generation, setxkbmap command generation, unchanged extension-path contract).de/macconfigured, Option+L types@in the interactive Browser window;xmodmapon the private display confirms Level3 ofLmaps toat.