Gentoo Archives: gentoo-user

From: Mart Raudsepp <leio@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Wayland - too early to try?
Date: Tue, 11 Jul 2017 19:27:15
Message-Id: 1499801223.1541.13.camel@gentoo.org
In Reply to: Re: [gentoo-user] Re: Wayland - too early to try? by Mick
1 Random information dump on the subject.
2
3 Wayland is no program, it is a protocol, that's it. dev-libs/wayland is
4 essentially a helper library to speak that IPC protocol.
5
6 The window manager has to be the compositor and other things as well
7 and do the input handling, window drawing, screenshot support, screen
8 capture support, etc etc.
9 Random programs can not take screenshots, listen to keys (think global
10 keys, e.g outside desktop shortcuts/push2talk voip) without some
11 protocol between the WM and the program. The Xorg programs for that
12 essentially make use of Xorg design security issues to do stuff like
13 take screenshots (random program can see your whole desktop screen with
14 Xorg), listen to input (keyloggers are trivial with Xorg), etc.
15 There are some standardization efforts going on between the desktop in
16 various areas of this, to define wayland protocols to more securely
17 support these things for applications. In some areas things are still
18 lacking.
19
20 To detect native wayland vs Xwayland or Xorg I like to use xprop.
21 Running that command and clicking it on a window will give information
22 about that window IFF it's using Xwayland or your whole session is in
23 Xorg.
24 But if you are still using Xorg, then you'll have a /usr/bin/X running.
25 There is no X running with a wayland WM, just Xwayland at most for
26 programs that don't support wayland natively.
27 Xwayland is a rootless X server to run on top of a wayland supporting
28 compositor. It's conceptually the same like Xquartz or Xming to run X11
29 clients in some other environment.
30
31 Wayland strives towards the "every frame is perfect" mantra. It is very
32 hard for toolkits and other things to draw things halfway on monitor
33 scan-out, so things like tearing are rather hard to accomplish, albeit
34 possible still in certain situations.
35
36 With wayland your programs need to do all the drawing themselves, which
37 actually means often pure software rendering, but thanks to the
38 smoothness of "every frame is perfect", it'll feel faster on your
39 common system. You don't have RENDER extension to do some acceleration
40 like you do in Xorg with many toolkits knowing about X RENDER (cairo in
41 the gtk+ world). To get hardware acceleration, the toolkit itself needs
42 to be able to use OpenGL (full or GLES), Vulkan, or similar. GTK+ 4
43 will be able to do both. Games typically already use OpenGL or Vulkan
44 and if they run natively on Wayland, they are still accelerated, often
45 with some things out of the way compared to Xorg. Programs that don't
46 run natively and end up using Xwayland are also accelerated via RENDER,
47 as Xwayland makes use of GLAMOR, which implements RENDER in the
48 (Xwayland rootless) X server on top of OpenGL. But as said, in practice
49 things are fast and smooth already as-is, even if software rendering.
50
51 One caveat of Wayland is that if the WM/compositor crashes, your whole
52 graphical session dies, while with Xorg the WM typically just restarts
53 and for the session to die, Xorg itself would have to die (and that's
54 been ironed out over the decades to very rarely do).
55
56 GNOME is indeed one of the leaders in adoption and implementing various
57 extra features on top of it (even middle-click PRIMARY paste,
58 seriously). EFL is probably another, and I think plasma is getting
59 there. And then you have the dedicated wayland compositors like Sway (a
60 i3-compatible approach). I bet there are something similar openbox-like
61 out there as well, but openbox itself definitely won't work, as it'd
62 have to be the compositor and not talk libX11..
63
64
65 HTH,
66 but probably you should have just googled ;)
67
68
69 Mart

Replies

Subject Author
Re: [gentoo-user] Re: Wayland - too early to try? Mick <michaelkintzios@×××××.com>