-
Notifications
You must be signed in to change notification settings - Fork 16.4k
fix: change default ozone platform hint to auto #35630
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we're deviating from Chromium on this?
@MarshallOfSound currently ozone platform initialization happens before the application JS entry point executes https://github.com/electron/electron/blob/main/shell/browser/electron_browser_main_parts.cc#L220-L221, so the flags Chrome does not set a default value for ozone platform https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/about_flags.cc;l=398 not sure why, but atleast it can still allow a dynamic setting since flag values can be read before platform initialization. |
a65dc48
to
fff3819
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is consistent with what was discussed in #35614
Pinging @MarshallOfSound for another look as per the Changes Requested |
I guess my question / concern here still stands. Why are we deviating from Chromium on this. Are end users going to experience issues that they wouldn't experience launching Chrome? |
Chromium provides a UI toggle in One notable difference between Electron and Chromium is that Chromium is an application while Electron is a toolkit1. This means end-users usually have only one Chromium application but many Electron applications so even if such a toggle would exist in Electron, it would still not be a practical solution because it would need to be toggled in every Electron app. So I would argue that in the current situation end-users are indeed experiencing issues in Electron that they do not experience in Chrome (#30897). #35630 and #35614 would both address this, but so far it looks like this pull-request is the preferred approach. Footnotes
|
I suppose the lack of updates means this pull-request is unlikely to progress until Chromium also changes the default ozone platform value. If that's the case, would #35614 be accepted as a stop-gap measure in the meantime? @MarshallOfSound |
fff3819
to
eb41173
Compare
eb41173
to
afa3b56
Compare
Is there any issue or even better PR where it has been requested to Chromium to change default ozone platform hint to auto ? |
afa3b56
to
58ef991
Compare
58ef991
to
737a628
Compare
Are there any news with regard to "fix: change default ozone platform hint to auto"? |
Would be strongly liked for every Linux desktops users... :) |
Is there a genuine issue that this change would cause? As far as I see it, this is an easy change that only has positives. This doesn't affect X11 users, and makes things so much better for Wayland users. Expecting Wayland users to not only know which apps are Electron based, but also having them apply the manual fix to every single one of them just feels like unnecessary work for the user. It's a lot of friction. If there are genuine issues that this change would create, then that's entirely understandable. And I don't think anybody wants more issues to pop up. But I haven't seen any. It's not likely, but it is possible we reach point where nobody uses X11 anymore, and Chromium still hasn't made this change. Would that still not be enough reason to deviate from Chromium? Because Wayland is simply inevitable in userspace at this point. |
To add to Candyhands' comment: Please keep in mind that there are also negatives not making this change. Many Electron applications are directed towards end users who have no clue what start parameters are. They just use the default and thus may see blurry Electron apps that cannot handle 4K properly, with other quirks in window management. |
There is at least the issue that chromium does not implement the tablet v2 protocol for wacom tablets etc link. Under xwayland that is not a problem. Here are related issues/pull requests by KDE and GNOME, though they only reinforce that the problem lies within chromium/electron. Wether this issue justifies the standard usage of xwayland instead of wayland is another discussion, I just wanted to hint to it. |
I think you're all barking up the wrong tree here. You should be trying to make the case on the Chromium issue tracker that the Ozone platform should default to auto there. Then that change would be synced to Electron once it's in a released version of Chromium. |
Do we have a link to the chromium issue? |
I dug through the Chromium issue tracker and was able to find https://issues.chromium.org/issues/40250220 referenced as an internal trial for @google.com users to default to Ozone Auto. Unfortunately it does not seem to be publicly visible so I can't see the results of said trial nor what other blockers may remain. Someone should probably create an issue for defaulting to Ozone auto separately. |
Digging a bit more, I found the chromium issue: |
No one is barking up. Comparing people to dogs isn't a friendly l'année to tell them you don't care about that they have to say, ask and request. As parrenin shows, the work is "on going" since 2016 without moving forward on Chromium side and there is no reason Electron could not make an independent choice for the time being to offer a better user experience to Wayland Linux users until Chromium decide also to do so. Then when this time will (if it will come) Electron will be able to follow again upstream. No argument have been given for Electron not being able to make an independent choice from upstream. So asking for change here is completely as relevant as asking it upstream, hoping for the most caring of its users to make the first move first. |
I somewhat agree. While yes, the ideal solution to this would be Chromium implementing this as the default. I think it's relatively safe to say that the maintainer of Chromium simply doesn't care about about adapting to the standards of the community in the same way that projects like this tend to. Just look at all the various objectively better changes Chromium has refused, such as their choice to deprecate JPEGXL even with major lobbying from companies like Adobe and various media outlets. Or them deprecating Manifest V3. While it would ideal for this change to happen in Chromium, Chromium simply isn't interested in most feedback from non-Google entities as far as I'm concerned. Hence why it is more reasonable to expect changes in downstream software such as Electron. |
For those who want to know more about the state of Wayland in Chromium, you can look at this video dating from June 2024: |
As much as I want electron to be wayland native, I would prefer they go with a strict upgrade without losing features. Unfortunately, it looks like chromium is just not ready. I do appreciate the updates though, it was really frustrating to see no public info on chromium and wayland in a while. |
Chromium is now using the Wayland Ozone platform on Wayland systems by default: https://chromium-review.googlesource.com/c/chromium/src/+/6819616 @MarshallOfSound Is it now a good time for me to rework this pull-request to do the same in Electron? |
Will we not just inherit that change from Chromium as it comes down the pipe? I think that would be the most ideal way of absorbing this change. |
Good point. I haven't looked at the code in a long time but I think it might get inherited. But it will probably still require some code cleanups on the Electron side too (e.g.: to get rid of the In any case, it might be best to wait until that change lands in Electron to see what it will look like and take it from there. |
Description of Change
As suggested in #35614 (comment), change default value of
--ozone-platform-hint
flag toauto
. This means the Wayland platform will be picked by default in Wayland environments and the X11 platform in Xorg environments.Applications without proper Wayland support can still force the X11 platform in Wayland environments using the
--ozone-platform=x11
(or--ozone-platform-hint=x11
) command line flag.Fixes #30897, #41551
Checklist
npm test
passesRelease Notes
Notes: Automatically pick Wayland platform in Wayland environments on Linux.