Fix: Immediately apply keyboard layout changes in greeter #313
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.
Addressing a critical usability issue where keyboard layout changes (specifically those impacting AltGr keys) were not being immediately recognized or applied in the Cosmic Greeter login screen.
After a clean install using a non-default keyboard layout (like Portuguese - Default), users were unable to type special characters that rely on the AltGr modifier key, such as:
@ (AltGr + 2 on Portuguese keyboard)
{ or ]
€ (AltGr + E)
This prevented users from logging into newly created accounts if their password contained such characters.
Changes
The fix ensures that the Greeter's compositor immediately loads the new XKB configuration by calling:
comp_config_handler.reload() after updating the xkb_config.
This change allows the keyboard layout to take effect immediately, resolving the inability to type special characters on the login screen.
Testing Steps (as per related issue pop-os/distinst#348)
Install Pop!_OS 24.04 Beta (or a similar Cosmic Epoch environment).
During installation:
Select a language (e.g., English - United Kingdom).
Select a layout that uses AltGr (e.g., Portuguese - Default).
Create a user account with a password containing the @ character.
Reboot to the login screen.
On the Cosmic Greeter login screen, attempt to type the password (specifically the @ character using AltGr + 2).
Expected Behavior with this Fix: The special characters should now be entered correctly, allowing the user to log in successfully.
Issue link: pop-os/cosmic-epoch#2242