Skip to content

Conversation

trop[bot]
Copy link
Contributor

@trop trop bot commented Jan 22, 2025

Backport of #45171

See that PR for details.

Notes: support Portal's globalShortcuts. Electron must be run with --enable-features=GlobalShortcutsPortal in order to have the feature working.

@trop trop bot requested a review from a team as a code owner January 22, 2025 11:00
@trop trop bot requested a review from a team January 22, 2025 11:00
@trop trop bot added 35-x-y backport This is a backport PR backport/requested 🗳 semver/minor backwards-compatible functionality labels Jan 22, 2025
@codebytere codebytere force-pushed the trop/35-x-y-bp-feat-support-global-shortcuts-via-globalshortcutsportal-feature-with-ozone-wayland-1737543596232 branch 3 times, most recently from 96a16ad to a0e6bfe Compare February 13, 2025 10:01
@codebytere codebytere force-pushed the trop/35-x-y-bp-feat-support-global-shortcuts-via-globalshortcutsportal-feature-with-ozone-wayland-1737543596232 branch from a0e6bfe to 6f7a280 Compare February 18, 2025 18:53
trop bot and others added 2 commits February 25, 2025 21:36
This backports a patch from Chromium, which fixes systemd unit
activation. That is, a globalShortcuts feature that Chromium has
needs to create a systemd unit and rename it properly. Portal's
global shortcuts uses that name afterwards to map the app with
the shortcuts bound. However, there might be a race between
Chromium binding shortcuts and renaming the unit.

This is a first step to add Portal's globalShortcuts to
Electron.

Co-authored-by: Maksim Sisov <[email protected]>
Chromium has a new feature called GlobalShortcutsPortal. It
allows clients to use Portal's globalShortcuts to register and
listen to shortcuts.

This patches adds necessary bits, which allows Electron to
use that feature.

In order to make it work, one has to add
--enable-features=GlobalShortcutsPortal

Test: tested manually with a sample app.

Co-authored-by: Maksim Sisov <[email protected]>
@codebytere codebytere force-pushed the trop/35-x-y-bp-feat-support-global-shortcuts-via-globalshortcutsportal-feature-with-ozone-wayland-1737543596232 branch 2 times, most recently from 869cf84 to aaba99d Compare February 26, 2025 14:34
Electron supports Portal's globalShortcuts API now via Chromium, and Electron
apps can use that in a Wayland session. Update the docs with the required
feature flag that must be passed to be able to use that implementation.

Co-authored-by: Maksim Sisov <[email protected]>
@codebytere codebytere force-pushed the trop/35-x-y-bp-feat-support-global-shortcuts-via-globalshortcutsportal-feature-with-ozone-wayland-1737543596232 branch from aaba99d to ea9ced2 Compare February 26, 2025 14:34
@codebytere codebytere changed the title feat: support global shortcuts via GlobalShortcutsPortal feature with ozone/wayland feat: support global shortcuts via GlobalShortcutsPortal feature with ozone/wayland Feb 26, 2025
@codebytere
Copy link
Member

hey @Obsessee i'm fixing it up now and will merge after this CI run hopefully passes.

@codebytere codebytere merged commit 18007f8 into 35-x-y Feb 27, 2025
55 checks passed
@codebytere codebytere deleted the trop/35-x-y-bp-feat-support-global-shortcuts-via-globalshortcutsportal-feature-with-ozone-wayland-1737543596232 branch February 27, 2025 10:33
@release-clerk
Copy link

release-clerk bot commented Feb 27, 2025

Release Notes Persisted

support Portal's globalShortcuts. Electron must be run with --enable-features=GlobalShortcutsPortal in order to have the feature working.

@ckerr
Copy link
Member

ckerr commented Feb 27, 2025

Something is wrong with our CI, this PR went green but it shouldn't've been able to build...? I don't know how CI went green but landing this causes 35-x-y (and today's release of 35.0.0-beta.11) to fail to compile.

This change is already present in 134.0.6998.23 and doesn't need to be patched in.

Doesn't look like this is some kind of two-PRs-in-flight-at-the-same-time issue either. @electron/wg-infra can someone PTAL?

I've put up a PR to remove the patch @ #45838

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

Labels

35-x-y backport/approved ✅ backport This is a backport PR semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants