Skip to content

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

Open
utrumo wants to merge 1 commit into
pop-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 into
pop-os:masterfrom
utrumo:fix/locker-xkb-watch

Conversation

@utrumo

@utrumo utrumo commented Apr 16, 2026

Copy link
Copy Markdown
  • 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

This PR stands on its own — any tool that changes xkb_config (Settings →
Keyboard, busctl, etc.) will trigger the locker UI refresh. The companion
pop-os/cosmic-comp#2296 additionally enables Super+Space to switch
layouts under session lock, completing the user-facing flow.

Test plan

  • Change xkb_config at runtime (e.g. via Settings → Keyboard → Input Sources,
    or directly through cosmic-config). Lock the screen — the dropdown
    checkmark and the layout label both reflect the new layout.
  • Lock the screen with multiple layouts configured — the active layout code
    (EN/RU/…) renders next to the keyboard icon.
  • Edge case: empty xkb_config.layout — only the icon renders, no label, no crash.
  • (Once input: allow layout switching and brightness/volume control under session lock cosmic-comp#2296 is merged) Use Super+Space on the lock
    screen to switch layouts — the dropdown checkmark and the layout label
    update live.

@jackpot51

Copy link
Copy Markdown
Member

The PR template is mandatory

@utrumo

utrumo commented Apr 17, 2026

Copy link
Copy Markdown
Author

@jackpot51, I fixed the PR description

@utrumo
utrumo force-pushed the fix/locker-xkb-watch branch from a19ed5d to 4f22449 Compare May 21, 2026 13:42
- 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.
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.

At lock screen, changing keyboard layout with keyboard shortcut does not update keyboard layout drop-down

2 participants