Skip to content

fix: add support for --ozone-platform-hint flag on Linux - #34937

Merged
codebytere merged 1 commit into
electron:mainfrom
vially:add-ozone-platform-hint-flag
Jul 21, 2022
Merged

codebytere merged 1 commit into
electron:mainfrom
vially:add-ozone-platform-hint-flag

Conversation

@vially

@vially vially commented Jul 17, 2022 •

Copy link
Copy Markdown
Contributor

Description of Change

Add support for the --ozone-platform-hint flag in order to make it easier for users to switch between the X11 and Wayland platforms (e.g.: by using --ozone-platform-hint=auto).

Implementation details

This was implemented by reusing the same logic from upstream, but it required implementing chrome::SessionEnding() which is a bit hacky. This was necessary due to this call from ChromeBrowserMainExtraPartsOzone::PostCreateMainMessageLoop().

Another option would have been to either patch that method or copy the logic from ChromeBrowserMainExtraPartsOzone and ChromeBrowserMainExtraPartsLinux inside Electron. If Electron maintainers think that's a more reasonable approach I'll update this pull-request accordingly.

EDIT: This description is no longer relevant because the implementation has been reworked with feedback from Electron maintainers.

Fixes #33810

Checklist

Release Notes

Notes: Added support for --ozone-platform-hint flag on Linux

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jul 17, 2022
@vially
vially force-pushed the add-ozone-platform-hint-flag branch from a0e92ce to ab3cc3a Compare July 17, 2022 21: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.

Can you copy the logic to support this flag into ElectronBrowserMainParts

int ElectronBrowserMainParts::PreEarlyInitialization() {

Electron has its own shutdown logic and bringing in ChromeBrowserMainExtraParts overrides this, also it is not necessary to support this flag.

@deepak1556 deepak1556 added semver/patch backwards-compatible bug fixes target/18-x-y labels Jul 18, 2022
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Jul 18, 2022
@vially
vially force-pushed the add-ozone-platform-hint-flag branch from ab3cc3a to 7807684 Compare July 18, 2022 17:27
@vially

vially commented Jul 18, 2022

Copy link
Copy Markdown
Contributor Author

@deepak1556 I've copied the logic from ChromeBrowserMainExtraPartsLinux into ElectronBrowserMainParts, as you've suggested (unless I've misunderstood).

However, it is a bit verbose so it may be worth moving it someplace else in order to keep ElectronBrowserMainParts a bit cleaner. Let me know what you think and whether you have any suggestions for refactoring it to make it slightly cleaner.

@vially
vially force-pushed the add-ozone-platform-hint-flag branch from 7807684 to 1a16523 Compare July 20, 2022 20:28

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

Thanks!

@codebytere
codebytere merged commit 67eda4b into electron:main Jul 21, 2022
@release-clerk

release-clerk Bot commented Jul 21, 2022

Copy link
Copy Markdown

Release Notes Persisted

Added support for --ozone-platform-hint flag on Linux

@trop

trop Bot commented Jul 21, 2022

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Jul 21, 2022

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Jul 21, 2022

Copy link
Copy Markdown
Contributor

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

@vially
vially deleted the add-ozone-platform-hint-flag branch July 21, 2022 08:41
@trop trop Bot added the merged/20-x-y label Jul 25, 2022
schetle pushed a commit to schetle/electron that referenced this pull request Nov 3, 2022
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: --ozone-platform-hint command line flag ignored

3 participants