Skip to content

feat: add support for ELECTRON_OZONE_PLATFORM_HINT env var - #39792

Merged
jkleinsc merged 2 commits into
electron:mainfrom
vially:add-ozone-hint-env-var
Sep 20, 2023
Merged

jkleinsc merged 2 commits into
electron:mainfrom
vially:add-ozone-hint-env-var

Conversation

@vially

@vially vially commented Sep 10, 2023

Copy link
Copy Markdown
Contributor

Description of Change

Note

This is a resubmit of #35614, since #35630 is still blocked on upstream/pending further discussion.

Add support for the ELECTRON_OZONE_PLATFORM_HINT environment variable in order to make it easier for users to enable Wayland support for all Electron apps without having to manually patch application .desktop files (or other similar workarounds #30897).

The accepted values are the same as upstream, with the special auto value being recommended for most users (especially for those switching between X11 and Wayland environments).

When both the --ozone-platform-hint command line flag and the ELECTRON_OZONE_PLATFORM_HINT environment variable are specified, the command line flag has higher priority.

Fixes #30897

Checklist

Release Notes

Notes: Added support for ELECTRON_OZONE_PLATFORM_HINT environment variable on Linux.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Sep 10, 2023

@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, pending CI pass

@deepak1556

Copy link
Copy Markdown
Member

/cc @jkleinsc @codebytere on the CI failure.

@codebytere

Copy link
Copy Markdown
Member

@vially can you please rebase?

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

Had a couple of nitpicks but the idea LGTM. Thanks for the patch!

@vially
vially force-pushed the add-ozone-hint-env-var branch from 4c9d8e6 to fad1b0a Compare September 11, 2023 16:15
@vially

vially commented Sep 11, 2023

Copy link
Copy Markdown
Contributor Author

@vially can you please rebase?

@codebytere I've rebased and addressed and @ckerr's comments.

@ckerr

ckerr commented Sep 12, 2023

Copy link
Copy Markdown
Member

CI is failing with these errors, unrelated to the code in the PR:

Forked prs not allowed to run on OSS projects

Is this something new? We've had lots of PRs submitted from outside contributors, e.g. this one from a couple weeks ago #39597

@codebytere

codebytere commented Sep 13, 2023 •

Copy link
Copy Markdown
Member

@ckerr it is an underlying infrastructure issue - it’s nothing to do with forked PRs or an actual setting despite what it says (we of course have that enabled)

it just needs to be rerun

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

@vially
vially force-pushed the add-ozone-hint-env-var branch from fad1b0a to 995c77e Compare September 14, 2023 19:27
@vially

vially commented Sep 14, 2023

Copy link
Copy Markdown
Contributor Author

@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Sep 17, 2023
@ckerr
ckerr requested a review from jkleinsc September 18, 2023 17:02

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

API LGTM

@jkleinsc
jkleinsc merged commit 58fd882 into electron:main Sep 20, 2023
@release-clerk

release-clerk Bot commented Sep 20, 2023

Copy link
Copy Markdown

Release Notes Persisted

Added support for ELECTRON_OZONE_PLATFORM_HINT environment variable on Linux.

@ckerr ckerr changed the title fix: add support for ELECTRON_OZONE_PLATFORM_HINT env var feat: add support for ELECTRON_OZONE_PLATFORM_HINT env var Nov 28, 2023
MrHuangJser pushed a commit to MrHuangJser/electron that referenced this pull request Dec 11, 2023
@QuarticCat

Copy link
Copy Markdown

Hi, can you also add an environment variable for --enable-wayland-ime? This is extremely helpful for people using an input method. I'm not familiar with the electron codebase and cannot find where to modify it.

bermeitinger-b pushed a commit to flathub/org.signal.Signal that referenced this pull request Jul 5, 2024
…ent variable (#607)

* Remove commandline flag to enable window decorations on wayland

Window decorations on wayland are enabled by default since electron v28 [1].

[1] electron/electron#39582

* Simplify logic to enable wayland ozone backend

This uses the new environment variable `ELECTRON_OZONE_PLATFORM_HINT` [1],
which is available since electron v28 [2].

[1] https://www.electronjs.org/docs/latest/api/environment-variables#electron_ozone_platform_hint-linux
[2] electron/electron#39792

* Deprecate `SIGNAL_USE_WAYLAND` environment variable

Prefer electron's new environment variable `ELECTRON_OZONE_PLATFORM_HINT`
instead.
@Twig6943

Copy link
Copy Markdown

What about something like this for --disable-gpu electron wayland sometimes doesn't work with gpu acceleration

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

Labels

Projects

None yet

7 participants