
Argumenting Client-Side Decorations - Mayzie
https://arcan-fe.com/2018/01/27/argumenting-client-side-decorations/
======
seba_dos1
I'm looking into starting implementing Wayland support in Allegro 5 game
library, which is basically a multiplatform way to get and handle a window
with OpenGL context inside. You get some drawing API, some helper functions
useful for games, events etc. There is no toolkit used, because why would it
need one?

So I can support KDE's SSD protocol. Fine, can do it. But... what about other
compositors, like GNOME's Mutter? Oh, great, so I'll have to implement full
working window decoration by myself, only for this single windowing system on
a single platform? How should it look? How should it behave? How should it be
configured? Who the hell even thought that would be a good idea?

OK, let's check SDL2 then, it's a quite similar and nowadays more popular
library, I wonder how did they do it, as I heard they have Wayland support
already done. Oh... window decorations on SDL2/Wayland are not implemented, so
there is just no decoration.
[https://bugzilla.libsdl.org/show_bug.cgi?id=2710](https://bugzilla.libsdl.org/show_bug.cgi?id=2710)

Awesome. I'll probably end up with the same thing, as I'm using KDE Plasma and
it will just work fine for me. Whatever.

CSD is an awful idea and whoever came up with it should feel bad. Massive step
back.

~~~
jhasse
I think the idea is that you use Gtk+ to get the window.

~~~
Doxin
Which is all fine and dandy if all you care about is GNOME, But presents a
real problem when you're trying to be cross-desktop-environment compatible.

~~~
jhasse
It isn't as cross-DE as it could be, but a lot more than just GNOME: MATE,
Budgie, Pantheon, XFCE, ...

------
makomk
One of the, ah, interesting Wayland quirks related to this is that because
Gnome didn't believe people needed the ability to minimize windows the
original wl_shell protocol for creating and managing windows had no way to
represent this action.

So in order for minimizing windows to work, every app has to use an extension
called xdg_shell to create and manage their windows instead, one that's not
guaranteed to be present and kept changing in backwards-incompatible ways.
(Not just any version either; it has to be xdg_shell v5 or later. Also,
apparently versions before v6 can't coexist with each other, trying to use a
mismatched version just stops the application from working at all.)

I believe xdg-shell is officially stable as of December, so it'll be a while
before it's supported everywhere and we don't yet know what happens if people
discover more use cases that have to be added. This happened quite some time
after major distros started shipping Wayland by default.

~~~
jhasse
> Gnome didn't believe people needed the ability to minimize windows

If that was true, why does GNOME include the ability to minimize then? The
only thing that was removed was the minmize _button_. Try Super+H or right
click -> Minimize.

~~~
seba_dos1
Sounds like this shortcut triggers an action performed by compositor, while
the parent is talking about actions triggered by applications.

~~~
jhasse
Ah I see, makes sense.

------
onli
If you read the article also have a look at the project this comes from. It's
hard for me to place exactly where this lies between X and Wayland and regular
WMs, but is is a pretty bold "I will do this all different" (or at least
different than what the mainstream is going with) where the project is really
creating something one can actually launch.

Which probably makes OPs opinion on questions such as this worthwhile to
consider.

------
cryptonector
The complexity and latency arguments are winners, clearly. And yet here we
are.

If you refuse to support remote displays, then you can probably get away with
not caring about latency. And who wants to support remote displays anyways?
Oh, well, right, ssh display forwarding, RDP, -- these exist for a reason:
users need remote displays! But if you can't run a browser remotely because
the latency is huge, and because every redraw involves sending entire
canvasses across the network, then you've clearly lost the war to support
remote displays.

(Keep in mind that no one needs a remote display to run an xterm. If the app
isn't graphical there's no point. And if the app is graphical then redrawing
by resending everything that the server has already seen... is just so much
hating your users.)

Now I know everything I needed to know about Wayland. What a wonderful FA.

EDIT: Is Wayland yet another case of NIH? Is Linux the land of the devs who
say NIH?

~~~
jhasse
You know that RDP has the same latency issue described in the article?

~~~
cryptonector
I referred to RDP as proof that people need remote displays. Did you not read
my comment?

~~~
jhasse
Yes. But something like RDP is perfectly possible with Wayland, see
[https://www.ctrl.blog/entry/wayland-gnome-remote-
desktop](https://www.ctrl.blog/entry/wayland-gnome-remote-desktop) for
example.

The latency issue is something you'll notice in the same way when working with
Windows' remote desktop (which uses RDP).

~~~
cryptonector
Boy you are thick.

I'm not saying that Wayland can't have remote displays. I'm saying that if you
want them (and we do) then you want low latency.

~~~
jhasse
Yes, and you mentioned RDP as an example, but it has the latency issue
described in the article (the same as a wayland Wayland solution would have).

~~~
cryptonector
I mentioned it as proof-by-existence of people wanting remote displays.
Thicker and thicker.

EDIT: Allow me to quote myself:

> And who wants to support remote displays anyways? Oh, well, right, ssh
> display forwarding, RDP, -- these exist for a reason: users need remote
> displays!

Is that not crystal clear? Several remote display technologies (X11, X11 over
ssh, RDP) that exist... because users need them.

~~~
jhasse
Yes, that's why Wayland will support remote display via something like RDP or
VNC, that was never out of question. What won't work is network transparency /
SSH forwarding.

~~~
cryptonector
Nor will it be low-latency.

~~~
jhasse
Do you think RDP's latency on Windows is okay?

Keep in mind that the latency is only for changes to the mouse cursor and some
window operations. Most of the time you will actually use the content of the
window which has the same latency as ssh -X forwarding.

------
Mayzie
/r/linux thread:
[https://www.reddit.com/r/linux/comments/7v8e9q/what_is_wrong...](https://www.reddit.com/r/linux/comments/7v8e9q/what_is_wrong_with_wayland_forcing_client_side/)

------
nine_k
A WM separate from clients is one of the most convenient things to me, and
something I miss most on Windows and macOS. Try moving or minimizing a window
of a misbehaving Windows app.

I hope Wayland is not bereft of this concept, and most well-behaved apps will
keep delegating windows management to it.

~~~
jhasse
Using the Windows key in GNOME Wayland you can move CSD windows around all the
time, even when they hang :)

