linebender / glazier

Deprecated Rust Window Creation Library
Apache License 2.0
207 stars 32 forks source link

Deciding the Linux strategy #106

Open xStrom opened 1 year ago

xStrom commented 1 year ago

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

Benefits of removing

Wayland

X11

Benefits of keeping

Benefits of removing

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.

jaredoconnell commented 1 year ago

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.

xStrom commented 1 year ago

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. We reached an agreement on the general strategy. :tada:

dvc94ch commented 1 year ago

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

xStrom commented 1 year ago

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.

dhardy commented 1 year ago

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.

Menus

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.

flukejones commented 1 year ago

However if we drop GTK then we're still left with both X11 and Wayland.

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™:”

jaredoconnell commented 1 year ago

However if we drop GTK then we're still left with both X11 and Wayland.

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: https://github.com/linebender/glazier/pull/107

nyabinary commented 1 year ago

I assume Wayland is tier 1, correct?

xStrom commented 1 year ago

I assume Wayland is tier 1, correct?

That is correct.