Skip to content

locker: watch xkb_config for live layout updates and show active layout label#439

Open
utrumo wants to merge 1 commit intopop-os:masterfrom
utrumo:fix/locker-xkb-watch
Open

locker: watch xkb_config for live layout updates and show active layout label#439
utrumo wants to merge 1 commit intopop-os:masterfrom
utrumo:fix/locker-xkb-watch

Conversation

@utrumo
Copy link
Copy Markdown

@utrumo utrumo commented Apr 16, 2026

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

Summary

  • Subscribe to com.system76.CosmicComp config changes so the locker
    refreshes active_layouts whenever xkb_config is modified at runtime
    (e.g. by Super+Space in the unlocked session). Previously the locker
    cached layouts at startup and never updated, leaving the dropdown
    checkmark pointing at a stale layout after any switch.
  • Show the active layout code (EN/RU/…) next to the keyboard icon on
    the lock screen so users can see which layout is active without opening
    the dropdown.

Test plan

  • Switch layouts several times via Super+Space in unlocked session
  • Lock the screen (Super+Esc or loginctl lock-session) — verify
    the dropdown checkmark matches the actually active layout (type a
    character to confirm)
  • Verify the layout label next to the keyboard icon updates on switch
  • Unlock, repeat with different starting layout
  • Edge case: empty xkb_config.layout — only the icon renders, no crash

- Subscribe to cosmic_config changes for com.system76.CosmicComp so
  active_layouts is refreshed whenever xkb_config changes at runtime
  (previously the locker cached active_layouts at startup and never
  updated, leaving the dropdown checkmark pointing at a stale layout).
- Extract refresh_active_layouts() from update_user_data() and reuse
  it from the new XkbConfigChanged handler.
- Show the active layout code (EN/RU/...) next to the keyboard icon
  on the lock screen so users don't have to open the dropdown to see
  which layout is currently active.
@jackpot51
Copy link
Copy Markdown
Member

The PR template is mandatory

@utrumo
Copy link
Copy Markdown
Author

utrumo commented Apr 17, 2026

@jackpot51, I fixed the PR description

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.

2 participants