Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jul 21, 2022

Conversation

vially
Copy link
Contributor

@vially vially commented Jul 17, 2022

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 in the last 24 hours 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
Copy link
Member

@deepak1556 deepak1556 left a comment

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 in the last 24 hours 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
Copy link
Contributor Author

vially commented Jul 18, 2022

@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
Copy link
Member

@deepak1556 deepak1556 left a comment

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
Copy link

release-clerk bot commented Jul 21, 2022

Release Notes Persisted

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

@trop
Copy link
Contributor

trop bot commented Jul 21, 2022

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

@trop
Copy link
Contributor

trop bot commented Jul 21, 2022

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

@trop
Copy link
Contributor

trop bot commented Jul 21, 2022

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