Skip to content

Application: Global shortcuts on Linux #1383

Closed

Description

@oneo-me

Context

Part of #1306. The roadmap's Application and windows section lists this item (line 150 of docs/roadmap.md at f7fc2f5c) with no issue.

Reference: XGrabKey, the GlobalShortcuts portal; NSH's #988

Acceptance

  • A shortcut reaches the app from any app, on Wayland once the user grants it; Linux uses the portal or X11 passive grabs, while showing a panel still needs surfaces

For: 开发@柚子

Activity

  1. added
    enhancement
    on Nov 21, 2026
  2. self-assigned this
    on Nov 22, 2026
  3. houko commented on Nov 22, 2026

    @houko
    Collaborator

    Verified the existing implementation on main ab9bfd1 against both acceptance paths. No runtime fix was needed.

    • X11: an actual XTest Ctrl+Alt+K press, sent with a different X client holding keyboard focus, reaches NSGo through the root-window passive grab and GDK event path. The other client keeps focus. Disposing the registration releases its grab, and the same chord then reaches that client instead of the app callback.
    • Wayland: an isolated GNOME 50.1 / Mutter 50.1 session with xdg-desktop-portal 1.21.1 displays the real Add Keyboard Shortcuts dialog for a fresh desktop ID. After Add, NSGo reports registered. A separate GTK application then confirms that it has active keyboard focus, and Ctrl+Alt+K sent through Mutter's native keyboard API reaches the NSGo callback. The final check also asserts a live portal session/subscription and an inactive NSGo window. This uses the real portal and compositor, not a constructed Activated callback.

    Regression and documentation PR: #2028 at d2efcba. It adds real external-client input coverage and an opt-in real-portal acceptance check. The existing runtime is unchanged.

    Validation: X11 shortcut and portal-response tests 6 passed / 1 opt-in skip; real fresh-grant Wayland check 1 passed; final portal/background check 1 passed; combined linux_x64 and linux_arm64 check passed; layering and skill checks 2 passed with all 26 layering configurations; changelog 11 passed.

    Closing because current main already meets this issue's acceptance criteria. The regression/docs PR remains open and unmerged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions