-
Notifications
You must be signed in to change notification settings - Fork 32
Deciding the Linux strategy #106
Comments
Some other relevant points:
I think it would be a good idea for those here that are still using X11 to test out running wayland under X11 (as described by the link above) to see if that is enough of a workaround to support legacy systems. |
There has been a bit of additional discussion on this topic in #glazier > Deciding the Linux strategy. We also had office hours today (2023-06-22) and spent most of the time discussing this issue.
|
Why not let xilem polyfill window decorations too? There is a Wayland extension for server side window decorations and if you're using a tiling window manager you don't want decorations anyway |
That is a very good question and it may make sense to do that. It would certainly solve the double text stack issue. Right now I personally haven't gotten too deep into Wayland window deocrations yet so I would say it's an open research question. |
Regarding decorations, the only thing I would want in Glazier is the ability to detect whether platform-provided decorations are supported (e.g. KDE on Wayland does, I think Gnome doesn't), and to control whether these are used (e.g. some apps prefer to use themed decorations). I don't see much value in adding decoration support in Glazier (like winit does). Especially if Glazier is targeted only at UI toolkits.
One thing about client-side decorations is that the client needs to be able to open the platform's window context menu. Well, the client should be able to, though some themed apps don't appear to support this. |
There is very little reason to keep X11 around. The general consensus in the Linux community seems to be growing very steadily towards a Wayland-only future - https://linux.slashdot.org/story/23/07/17/0159246/is-wayland-becoming-the-favored-way-to-get-a-gui-on-linux My apologies for a drive-by 2-cents comment, but a project I highly depend on (lapce) is dependant on glazier, and I would love to see a narrower focus agreed on for glazier. Edit: I will additionally add that dropping GTK as a backend seems to be a logical and good choice. It will reduce the workload, and from what I've seen around the places I lurk the primary reason many are choosing glazier is not for a GTK backend, but for windowing only (and the additional features expected of a desktop window). I'll reiterate that focusing solely on a single backend is “Right Thing™:” |
According to the discussions in the office hours meeting, we dropped GTK, and set X11 as a tier 2 backend, meaning that it will not be as much of a priority, and would be removed if it becomes too much of a limiting factor. In addition, there is progress towards re-writing the wayland backend: #107 |
I assume Wayland is tier 1, correct? |
That is correct. |
Druid never settled on a clear Linux strategy. At first there was only the GTK backend due to the simplicity of implementation.
Then there were experimental backends for X11 and Wayland. Bringing the total to three. No clear focus, lots of effort spread thin.
There were several attempts to reach some sort of clarity on how to reduce the scope, but unfortunately no decisions made.
Complexity kills. Lack of focus kills. The scope of Glazier is already enormous with targeting Windows, macOS, web (sort of), and tentative plans for both Android and iOS. Having multiple backends for Linux doesn't seem like well spent resources. Yes there are occasional champions who contribute to specific backends, but for the general success of Glazier new features should work well on all platforms and receive proper maintenance. Far fewer volunteer for such ongoing work. Also, speaking as someone who tests all the Glazier platforms, I would love to spend less time on all the various Linux quirks.
I think it would serve us well to reduce scope and increase focus.
With that in mind, I went through the historic Druid discussion threads and also did a bit of digging across the Linux ecosystem landscape to see how things are today and how things are likely to be in a few years.
Cutting options
The first question is whether we should drop GTK or embrace it.
If we embrace GTK, then it would be rather straightforward to drop support for both X11 and Wayland native backends.
However if we drop GTK then we're still left with both X11 and Wayland. Still double the number of backends per platform compared to other platforms. Thus I think in the case where we drop GTK we should also seriously consider dropping X11 and focus solely on Wayland.
With such a decision tree in mind, I'll present various points regarding each of the backends.
GTK
Benefits of keeping
GTK has already solved a lot of issues that we'll need to redo.
We've already implemented a lot of the GTK integration.
Probably the fastest path, in dev time, to a stable Linux backend.
Most attractive when the alternative is to keep both Wayland and X11 as opposed to only Wayland.
As GTK 4 will provide both X11 and Wayland support for us, while being only a single backend for Glazier.
Benefits of removing
There is some uncertainty around how well the Glazier model with Vello can even work with GTK.
There are various claims that it can be done, but at the moment nobody has actually spent the time to do it.
People have complained about the GTK compile times for years. Most recently in #101.
Some historic Druid tests showed it almost an order of magnitude slower than Windows.
People have also complained about app startup time.
Significantly reduces our dependency graph. A lot of it written in C. Results in faster compile times and potentially fewer security bugs.
Gives us a higher degree of control.
We're still on GTK 3 and should probably migrate to GTK 4. Removing the GTK backend skips that work.
Support for running on systems that don't have GTK installed. Admittedly not too many of those, but the dependency is huge.
Wayland
Clearly the future. Various major Linux ecosystem projects are overwhelmingly in agreement.
The differences in thought come from the assessment of progress towards it.
However the progress is towards it.
We already need to do a large amount of work on our Wayland backend.
It would be a lot easier to justify this focus if this was essentially synonymous with Linux support.
Removal only makes sense if we focus on GTK instead.
X11
Benefits of keeping
We've already done a good chunk of the work.
Ability to run on setups that are either running old distributions or are custom configured to run X11.
There isn't a lot of statistics available on display server usage, but we have a tiny bit - sample size 5500 across distributions.
Keep in mind that the kind of person that would seek out self reporting like this is also more likely to change their defaults.
So reality is probably skewed more towards distribution defaults. That said, I'll link three Wayland usage charts.
The trend is aggressively towards Wayland. Wayland has been available for a long time, but adoption has really accelerated in just the last few years. All signs point towards the acceleration only growing. However it is an open question how long the last 10% will hold out.
Benefits of removing
X11 is increasingly abandoned.
It still works but is missing support for modern features and that list will only grow.
Legacy quirks are guaranteed to remain.
Significantly reduces our maintenance burden of the Linux platform.
Reduces our dependency graph even more.
App developer experience improves drastically if Linux is just one backend,
because otherwise the app code needs to perform runtime checks on X11 vs Wayland guarded by a Linux cfg attribute.
X11 has no support for wide color gamuts or HDR and there are no plans either.
Wayland doesn't have real support either, but there is serious ongoing work.
For us to support these modern features X11 would at a minimum be a heavily degraded experience.
GTK team considered removing the X11 backend from GTK for the future GTK 5 release.
Their current plan is to stop building the X11 backend by default in GTK 5,
but they also aren't rushing to delete the code .. at least until the next major refactor.
In general, the vibe I get from the GTK team is that they don't want to spend any more resources on X11 support.
Qt 6 docs state:
In fact, it is difficult to run a client fluidly with X11, and reach 60 fps without tearing.
Wayland, in contrast, is easier to implement, has better performance,
and contains all the necessary parts to run efficiently on modern graphics hardware.
Running fluidly at 60 fps, or indeed 144 fps, is one of the core goals of the Linebender stack.
If both GTK and Qt, the two biggest Linux GUI toolkits, are convinced that Wayland is the superior future,
then why would we, with less resources, invest in X11 support for our toolkit that won't even be ready for years.
Opportunity for Glazier to help shape the future of Linux desktop.
Yes Wayland has issues. If the path of least resistance is to just go back to X11, then Wayland issues remain.
If switching back to X11 isn't easy, then the path of least resistance becomes to fix the Wayland issues.
Instead of helping keep the fragmentation the way it is, we could be championing for the shift.
In the bigger Linebender picture we're already building for the future by targeting compute shaders and WebGPU.
It seems to fit thematically that we'll also focus on the latest display server.
Although I guess you could make the case that supporting X11 is similar to having a CPU fallback in Vello.
GNOME has defaulted to Wayland since ca Fedora 25.
The KDE team is pushing for Wayland by default in the upcoming Plasma 6 release.
(Estimated release date Q1 2024)
Fedora has defaulted to Wayland with Plasma since Fedora 34, and with GNOME since Fedora 25.
The Fedora team is pushing to take it even further and have the Fedora Plasma 6 ship without X11.
Red Hat Enterprise Linux 9 deprecated X11, defaults to Wayland. X11 planned for removal in RHEL 10.
Ubuntu has defaulted to Wayland since Ubuntu 21.04.
Debian has defaulted to Wayland with GNOME since Debian 10.
Glazier 1.0 isn't likely for another few years.
While large Linux distributions are looking to remove as much X11 code as they can,
should we be looking to write new X11 code for 2025 and beyond? Seems like swimming against the current.
It is better to cut scope and increase focus.
Deliver a single Wayland backend that is excellent, instead of two backends that are merely good.
Previous discussions
Feedback welcome
Given that the primary issue with having three Linux backends is the amount of work required, I especially want to encourage people to respond here if they have even tentative plans to contribute work towards specific backends.
In general, if anyone has more reasons to add or want to amplify one of the above reasons on why we should go with any of these options, please share your thoughts.
The text was updated successfully, but these errors were encountered: