Skip to content

input: allow layout switching and brightness/volume control under session lock - #2296

Merged
Drakulix merged 1 commit into
pop-os:masterfrom
utrumo:fix/unlock-input-source-switch
May 27, 2026
Merged

input: allow layout switching and brightness/volume control under session lock#2296
Drakulix merged 1 commit into
pop-os:masterfrom
utrumo:fix/unlock-input-source-switch

Conversation

@utrumo

@utrumo utrumo commented Apr 16, 2026

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

Allow common multimedia keys to work on the lock screen by extending
the early-return whitelist:

  • Super+Space — switch keyboard layout
  • XF86MonBrightnessUp/Down — display brightness
  • XF86AudioRaiseVolume/LowerVolume, XF86AudioMute — audio output

All added actions flow through the existing System handler.

Layout switching is functional standalone (the new layout is applied and
typed-into-password fields use it), but the locker UI (dropdown checkmark
and active-layout label) will not reflect the change without the companion
pop-os/cosmic-greeter#439, which subscribes to xkb_config updates.

Test plan

  • Lock the screen (Super+Esc or loginctl lock-session) and verify each key:
    • Super+Space switches layout (functional; visual update requires cosmic-greeter#439)
    • Brightness up/down adjusts display brightness
    • Volume up/down/mute adjusts audio
  • Same keys still work in unlocked session
  • Other shortcuts under lock (e.g. Super+T) — still blocked

@jackpot51

Copy link
Copy Markdown
Member

The PR template is mandatory

@utrumo
utrumo force-pushed the fix/unlock-input-source-switch branch from 2834101 to 9fb075f Compare April 17, 2026 13:53
@utrumo

utrumo commented Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

@jackpot51, I fixed the PR description

@utrumo
utrumo force-pushed the fix/unlock-input-source-switch branch from 9fb075f to 382d001 Compare May 21, 2026 13:42

@Drakulix Drakulix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simply exclude the InputSourceSwitch action from the early return when a lock screen is engaged?

@utrumo
utrumo force-pushed the fix/unlock-input-source-switch branch from 382d001 to c1c0538 Compare May 22, 2026 22:20
@utrumo

utrumo commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

@Drakulix, you were right, I overcomplicated this too much. Your approach is cleaner. I've rewritten the PR. I also added keys for brightness and volume control.

@utrumo utrumo changed the title input: allow InputSourceSwitch under session lock via direct D-Bus call input: allow layout switching and brightness/volume control under session lock May 22, 2026
@utrumo utrumo changed the title input: allow layout switching and brightness/volume control under session lock input: Allow layout switching and brightness/volume control under session lock May 22, 2026
@utrumo utrumo changed the title input: Allow layout switching and brightness/volume control under session lock input: allow layout switching and brightness/volume control under session lock May 22, 2026

@Drakulix Drakulix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Drakulix
Drakulix requested a review from a team May 22, 2026 23:24

@leviport leviport left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes volume up/down/mute, laptop screen brightness up/down, and keyboard layout switch hotkeys work at the lock screen. It does not enable them at the initial login screen, but that's outside of the scope of this PR.

I did notice that the keyboard layout button and drop-down don't update when I change my keyboard layout with the keyboard hotkey. For example, if I have both Dvorak and QWERTY enabled and have Dvorak active, pressing Super + Space changes the layout, but clicking the layout button on the greeter reveals a drop-down with Dvorak still selected, even though QWERTY keystrokes are still being typed. I think this is a cosmic-greeter bug, so I will open an issue in that repo.

@utrumo

utrumo commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

@leviport, I fixed it in this mr:
pop-os/cosmic-greeter#439

@Drakulix
Drakulix merged commit 22fe419 into pop-os:master May 27, 2026
4 checks passed
@utrumo
utrumo deleted the fix/unlock-input-source-switch branch May 27, 2026 16:08
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.

4 participants