VerteDinde

#52221: fix: enable GlobalShortcutsPortalPreferredTrigger by default on Linux

Merged
Created: Jul 1, 2026, 3:48:31 PM
Merged: Jul 1, 2026, 11:34:14 PM
2 comments
Target: main

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.

Backports

43-x-y
In-flight
PR Number
#52228
Waiting to be merged

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron