Skip to content

fix: enable GlobalShortcutsPortalPreferredTrigger by default on Linux - #52221

Merged
VerteDinde merged 1 commit into
mainfrom
enable-global-shortcuts-portal-gnome
Jul 2, 2026
Merged

VerteDinde merged 1 commit into
mainfrom
enable-global-shortcuts-portal-gnome

Conversation

@VerteDinde

@VerteDinde VerteDinde commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Enables GlobalShortcutsPortalPreferredTrigger by default on Linux, so that globalShortcut works on GNOME Wayland out of the box. Inspired by a conversation with @mitchchn.

Chromium gates the GlobalShortcuts portal on GNOME behind GlobalAcceleratorListener::GetInstance added in crrev.com/c/7620219). When the feature is off, every globalShortcut.register() call fails silently, from the app's perspective. On GNOME Wayland (the only GNOME session type on Ubuntu 26.04), that means globalShortcut is a no-op unless every Electron app author independently discovers a Chromium feature flag.

This is a no-op outside GNOME. Verified against a local build on Linux (headless Ozone, private session bus, simulated XDG_CURRENT_DESKTOP=GNOME):

  • Before: globalShortcut.register() → false on GNOME with no flags (listener never created).
  • After: register() → true on GNOME with no flags; portal session is created.
  • After + --disable-features=GlobalShortcutsPortalPreferredTrigger: register() → false (user override wins).
  • Non-GNOME: true before and after (unchanged).

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes locally
  • PR title follows semantic commit guidelines

Release Notes

Notes: Fixed globalShortcut not working on GNOME Wayland by enabling Chromium's GlobalShortcutsPortalPreferredTrigger feature by default on Linux.

@VerteDinde VerteDinde added semver/patch backwards-compatible bug fixes target/43-x-y PR should also be added to the "43-x-y" branch. labels Jul 1, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jul 1, 2026
Chromium gates the GlobalShortcuts portal off on GNOME behind this
feature, which makes globalShortcut a silent no-op on GNOME Wayland
unless apps discover and pass a Chromium feature flag. Enable it by
default; GNOME still consent-gates the first bind, and a user-passed
--disable-features=GlobalShortcutsPortalPreferredTrigger takes
precedence.
@VerteDinde
VerteDinde force-pushed the enable-global-shortcuts-portal-gnome branch from f9a17d6 to 6b797e2 Compare July 2, 2026 02:19

@deepak1556 deepak1556 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.

LGTM, thanks for attaching the upstream context.

Comment thread shell/browser/feature_list.cc Resolved
@VerteDinde
VerteDinde merged commit fe734bb into main Jul 2, 2026
75 checks passed
@VerteDinde
VerteDinde deleted the enable-global-shortcuts-portal-gnome branch July 2, 2026 04:34
@release-clerk

release-clerk Bot commented Jul 2, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed globalShortcut not working on GNOME Wayland by enabling Chromium's GlobalShortcutsPortalPreferredTrigger feature by default on Linux.

@trop

trop Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #52228

@trop trop Bot added in-flight/43-x-y and removed target/43-x-y PR should also be added to the "43-x-y" branch. labels Jul 2, 2026
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. and removed in-flight/43-x-y labels Jul 15, 2026
claude Bot pushed a commit that referenced this pull request Aug 17, 2026
- drop CHROME_DESKTOP and systemd scope implementation details
- point reverse-DNS naming guidance at the Desktop Entry spec
- remove the xdg-desktop-portal dashed-name parsing bug callout
- update the GNOME feature flag guidance: portal path is now enabled
  by default (#52221)
- hold off documenting the optimistic register() behavior until the
  async registration API lands

No-Verification-Needed: docs-only change
VerteDinde added a commit that referenced this pull request Aug 17, 2026
* docs: desktopName is the Linux portal identity; document Wayland shortcut flow

desktopName sets CHROME_DESKTOP, which becomes the Wayland app_id /
WM_CLASS, the systemd scope name, and the app ID xdg-desktop-portal
reports to portal backends. Portals now enforce that identity (GNOME 50
denies GlobalShortcuts binds for invalid IDs), so document the
reverse-DNS requirement and the Wayland portal flow for globalShortcut:
consent dialog on GNOME, silent binds on KDE, persistence across
relaunches, the feature flag currently needed on GNOME, and the
optimistic register() return value.

* docs: address review feedback

- drop CHROME_DESKTOP and systemd scope implementation details
- point reverse-DNS naming guidance at the Desktop Entry spec
- remove the xdg-desktop-portal dashed-name parsing bug callout
- update the GNOME feature flag guidance: portal path is now enabled
  by default (#52221)
- hold off documenting the optimistic register() behavior until the
  async registration API lands

No-Verification-Needed: docs-only change
MarshallOfSound pushed a commit that referenced this pull request Aug 17, 2026
* docs: desktopName is the Linux portal identity; document Wayland shortcut flow

desktopName sets CHROME_DESKTOP, which becomes the Wayland app_id /
WM_CLASS, the systemd scope name, and the app ID xdg-desktop-portal
reports to portal backends. Portals now enforce that identity (GNOME 50
denies GlobalShortcuts binds for invalid IDs), so document the
reverse-DNS requirement and the Wayland portal flow for globalShortcut:
consent dialog on GNOME, silent binds on KDE, persistence across
relaunches, the feature flag currently needed on GNOME, and the
optimistic register() return value.

Co-authored-by: Keeley Hammond <[email protected]>

* docs: address review feedback

- drop CHROME_DESKTOP and systemd scope implementation details
- point reverse-DNS naming guidance at the Desktop Entry spec
- remove the xdg-desktop-portal dashed-name parsing bug callout
- update the GNOME feature flag guidance: portal path is now enabled
  by default (#52221)
- hold off documenting the optimistic register() behavior until the
  async registration API lands

No-Verification-Needed: docs-only change

Co-authored-by: VerteDinde <[email protected]>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <[email protected]>
codebytere pushed a commit that referenced this pull request Aug 17, 2026
* docs: desktopName is the Linux portal identity; document Wayland shortcut flow

desktopName sets CHROME_DESKTOP, which becomes the Wayland app_id /
WM_CLASS, the systemd scope name, and the app ID xdg-desktop-portal
reports to portal backends. Portals now enforce that identity (GNOME 50
denies GlobalShortcuts binds for invalid IDs), so document the
reverse-DNS requirement and the Wayland portal flow for globalShortcut:
consent dialog on GNOME, silent binds on KDE, persistence across
relaunches, the feature flag currently needed on GNOME, and the
optimistic register() return value.

Co-authored-by: Keeley Hammond <[email protected]>

* docs: address review feedback

- drop CHROME_DESKTOP and systemd scope implementation details
- point reverse-DNS naming guidance at the Desktop Entry spec
- remove the xdg-desktop-portal dashed-name parsing bug callout
- update the GNOME feature flag guidance: portal path is now enabled
  by default (#52221)
- hold off documenting the optimistic register() behavior until the
  async registration API lands

No-Verification-Needed: docs-only change

Co-authored-by: VerteDinde <[email protected]>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <[email protected]>
HowmationFr added a commit to HowmationFr/voksa that referenced this pull request Oct 26, 2026
- panic.ts: GNOME Wayland now binds global shortcuts through the xdg
  GlobalShortcuts portal (electron/electron#52221, new in 45), with a
  consent dialog the first time.
- entitlements: better-sqlite3 is a prebuilt N-API addon now.
- smoke: CI runs Node 22, the `ws` fallback is not about Node 20.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/43-x-y PR was merged to the "43-x-y" branch. new-pr 🌱 PR opened recently semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants