
An introduction to Wayland - ddevault
https://drewdevault.com/2017/06/10/Introduction-to-Wayland.html
======
the_common_man
> Wayland is the new hotness on the Linux graphics stack

Use wayland (with gnome) everyday myself but wanted to point out that wayland
started almost 10 years ago :) The adoption has taken forever though partly
because of the infinite legacy of X11 and lack of support from big players
like nvidia.

~~~
lmm
Adoption has taken forever mostly because it's a solution in search of a
problem, at least in terms of how it's been sold to users. The main user-
visible difference is "lose the ability to run remote programs on your local
display" \- you can understand why users aren't lining up for that.

~~~
oconnor663
For what it's worth, I might be a more-obsessive-than-average user, but it
kills me when I see tearing and flickering in X11 windows. "Every frame is
perfect" is a super visible change :)

Btw, am I right that tearing in a video in VLC is an X11 interaction, or is
that purely a VLC thing that I should expect to keep happening with Wayland
support?

~~~
intoverflow2
> but it kills me when I see tearing and flickering in X11 windows

Honestly don't think this will ever be solved in the open source world. It
rarely even gets solved in the commercial world unless there is an internal
design team involved who have enough power to force the dev team to solve
these things. Win 10 for example has some silky smooth transitions but then
you resize an explorer window and it flickers black.

So many people don't even seem to notice it but for some of us it's nails on a
chalkboard.

------
lol768
Interesting article, nice to see some more practical examples.

For those unaware, SirCmpwn is responsible for sway -
[https://github.com/SirCmpwn/sway](https://github.com/SirCmpwn/sway) \- which
aims to be an i3 compatible compositor for Wayland. In my experience it's not
production ready yet, but it's definitely a pretty cool project to keep an eye
on if you do use i3.

~~~
Sir_Cmpwn
Out of curiosity, when was your last exposure to Sway? Many people use it as
their daily driver and would agree that it's production ready (even if it's
not done). Can you report any bugs you find?

~~~
mazamats
The most annoying thing is the mouse lag and higher resource utilization
compared to i3.

Aside from that, it's great though. I used it for a month before going back to
i3, you've really put a good amount of work into the project.

~~~
Sir_Cmpwn
That's fair, it definitely has inferior performance.

~~~
riquito
What are the reasons? Is there any problem that cannot be solved?

~~~
Sir_Cmpwn
A lot of it comes down to the choice to use wlc[1], a library that provides
some of the low-level plumbing for Sway. It was great for getting Sway up and
running quickly, but it's not very flexible for the directions we want to go.
Most of Sway's performance issues are due to WLC or decisions Sway had to make
to accomodate WLC.

Currently most of the work on Sway is being done on wlroots[2], with the goal
of replacing wlc. The design is much more flexible and should have better
performance and should avoid imposing constraints on Sway that impact its
performance. A lot of Sway features are also currently blocked by wlroots,
since wlc isn't flexible enough to allow us to implement them. I'm actually
lucky enough to be working on wlroots full time at the moment, thanks to a
generous commercial sponsor[3], along with some support from Patreon[4]. The
future is definitely bright for Sway :)

[1] [https://github.com/Cloudef/wlc](https://github.com/Cloudef/wlc) [2]
[https://github.com/SirCmpwn/wlroots](https://github.com/SirCmpwn/wlroots) [3]
[https://nyantec.com/](https://nyantec.com/) [4]
[https://www.patreon.com/sircmpwn](https://www.patreon.com/sircmpwn)

------
AdmiralAsshat
Fun fact: Wayland is supported on ChromeOS versions 50 and above for the
supported Android applications.[0][1] Consequently, you can run Fedora with
Wayland on a supported Chromebook using crouton.[2]

[0][https://bugs.chromium.org/p/chromium/issues/detail?id=549781](https://bugs.chromium.org/p/chromium/issues/detail?id=549781)

[1][http://www.phoronix.com/scan.php?page=news_item&px=Google-
Ch...](http://www.phoronix.com/scan.php?page=news_item&px=Google-Chrome-50)

[2][https://nmilosev.svbtle.com/crouton-fedora-wayland-yes-
pleas...](https://nmilosev.svbtle.com/crouton-fedora-wayland-yes-please)

~~~
y4mi
nice, i've actually reset my chromebook (removing crouton) a few month ago
because the constant context switching annoyed me... i think ill reenable it
later today and try that out

------
makomk
If I recall correctly, one major catch is that wl_shell has been feature-
frozen since 2012 and lacks newfangled features like the ability to minimize
windows. For newer functionality you need to use xdg-shell instead, which
regularly changes in backwards-incompatible ways and there's no guarantee the
version your application implements (or any version of it) will actually be
available.

~~~
paulmlewis
I don't follow Wayland closely but there's a thread proposing stabilisation
from a little while back [https://lists.freedesktop.org/archives/wayland-
devel/2017-Ma...](https://lists.freedesktop.org/archives/wayland-
devel/2017-May/034170.html)

------
amelius
I was hoping for a somewhat broader and more abstract discussion of the
concepts used in Wayland (and not C structures).

------
moomin
A question that may only be of interest to me: is anyone looking at getting
Wayland running on Windows? In particular, interacting with the new WSL stuff?

~~~
Sir_Cmpwn
I imagine it's possible, but complicated. You'll likely need a custom backend
for your compositor - I doubt WSL implements DRM (display resource
management).

~~~
int_19h
WSL doesn't support the graphics stack at all. But it is possible to VNC or
RDP (with xrdp as a server) into an X11 session running inside WSL, so that's
what people do.

You wrote below that Wayland supports RDP. If so, it sounds like that should
work?

~~~
Sir_Cmpwn
I wrote below that Weston (a specific Wayland compositor) supports RDP and
that Sway eventually will. But yes, Weston might work on Windows in that case.

------
Animats
Why does this remind me of CORBA?

~~~
moomin
It's definitely using the same IDL->language dependent API as CORBA, but that
doesn't mean it has to be an out of control garbage fire.

~~~
gcb0
doesnt mean it won't either.

minimize is already shoved in the debug api. sigh, in the end I really hope
nobody but qt/gtk/sdl devs are even getting close to this.

~~~
digi_owl
On that note, Torvalds rants about some missing functionality in some G+
comments i came across.

[https://plus.google.com/+KeithPackard/posts/azxz8ZPKght](https://plus.google.com/+KeithPackard/posts/azxz8ZPKght)

Sadly it seems impossible to link to individual comments.

------
pmoriarty
Is something like VNC or some other way to remotely view a desktop or an app
going to be possible in Wayland?

~~~
Sir_Cmpwn
Weston supports RDP and in the future Sway will as well.

~~~
GrayShade
Last time I tried, weston-rdp was unusuable: slow, high bandwidth usage and
had trouble with key repeat (pressing a key even for a short while resulted in
multiple characters).

------
bradstewart
Has anyone been able to run Chrome (or anything Electron based) on Wayland in
a virtual machine? I just a black rectangle instead of Chrome/VSCode/etc.

Disabling GPU acceleration for Chrome via command line flags or for the VM
entirely seems to fix it, but that's obviously a non-solution.

I'm running Fedora 25 in a VMWare Workstation 12 with a Windows 10 host.

------
Tharkun
Are there any decent, minimalistic tiling WMs for Wayland yet? IIRC awesomewm
wasn't planning on supporting Wayland.

~~~
KitDuncan
Sway (basically i3) I actually used for quite a while as my daily driver and
it works great. Another one I want to check out soon is Way Cooler.

[https://github.com/SirCmpwn/sway](https://github.com/SirCmpwn/sway)
[https://github.com/way-cooler/way-cooler](https://github.com/way-cooler/way-
cooler)

------
sanbor
I'm surprised to see XML. Wouldn't JSON or some other format be a better
choice?

~~~
quotemstr
XML has several advantages over JSON: it's much better at self-documentation
and the schema validation tools are more powerful. Namespaces compose
elegantly. XML has a bad reputation due to enterprise-y abuse of the
technology, but that does't mean it's a fundamentally bad idea.

~~~
legulere
I never saw a nice use-case of namespaces. Maybe you can show me one?

So far I have only seen namespaces used by Inkscape to state that a SVG is a
still image using 3 different name-spaces in one hierarchy. Does it not just
add complexity to need to support different standards at the same time

~~~
josteink
> I never saw a nice use-case of namespaces. Maybe you can show me one?

Basic example: If you want to mix data from several formats in one document.

Let's say you want to create an RSS-feed which contains information about "new
stuff" whatever that new stuff is. This "new stuff" may actually be other XML-
data which can be parseable and processable by other tools (like for instance
new builds, deployments, whatever). This data probably has a format of sorts
individually, independent of the RSS-feed itself, which has its own well
defined format.

Now let's say both the RSS-feed and the custom-data contains both a "link"
element and a "title" element. Without namespaces, these are bound to collide.

Some examples of problems which then arises:

\- How can a RSS-library validate that the feed format itself is correct?

\- How does a RSS-feed library know which "link" elements it should process
and display, instead of only ones which belongs to the _feed definition_?

\- How does the RSS-processing library know that it should most definitely
ignore _that title_ which belongs to the deployment metadata?

\- Etc etc

Namespaces allows you to combine data from different formats without ever
running the risk of the data getting mixed up by whoever consumes them.

It's a really basic feature, and it's at the core of the whole eXtensible bit
of XML. I'm honestly surprised by both the amount of people who find this
confusing and how few people are able to realize the value of such a simple
construct.

I guess too many "1337 HTML ninja rockstars" got introduced to XML as "just
another angle-bracket markup format" and never actually bothered to learn
anything about absolutely foundational XML basics.

~~~
legulere
> Basic example: If you want to mix data from several formats in one document.

Can you get more concrete on why you would want to mix formats? So far what I
have seen namespaces were used just to extend one format.

> Now let's say both the RSS-feed and the custom-data contains both a "link"
> element and a "title" element.

Easily avoided if you just extend one format, but can happen if you would want
to mix existing formats because of some reason.

> \- How can a RSS-library validate that the feed format itself is correct?

You still need some code that parses the non-RSS part anyway, which can
validate it. Don't you usually have just one parser that parses RSS and the
non-RSS at the same time? If not, how are you passing your non-RSS XML tree-
parts from the RSS-only library to the "new stuff"?

~~~
josteink
> You still need some code that parses the non-RSS part anyway, which can
> validate it.

Provenly incorrect.

How many RSS validators validates the contained HTML (as HTML, not as per XML
well-formedness)?

