5 ms·
You underestimate the inherent complexity of Wayland. As exercise I recommend to implement a "Hello World" native Wayland client. Watch and see the complexity e
by sprash 6y ago
You underestimate the inherent complexity of Wayland. As exercise I recommend to implement a "Hello World" native Wayland client. Watch and see the complexity explode when you simply want to add the functionality to take screenshots to that client.
- cycloptic 6y agoI'm not sure what kind of "Hello World" clients you're comparing, but if you check the Wayland backends in Gtk/Qt, you will actually find them to be smaller than the respective X11/XCB backends there, for various reasons.
- sprash 6y agoI'm specifically not talking about toolkits. I'm talking about a "simple" native Wayland client. Try to write one and witness utter insanity.
- cycloptic 6y agoCan you be more specific about what are you comparing this to? An X client with similar functionality would likely be longer and require several X extensions.
- jude- 6y ago> you will actually find them to be smaller than the respective X11/XCB backends there, for various reasons. It doesn't seem surprising to me. As X.org has gained extensions over the last 30 years, toolkits that speak X11 find themselves having to decide which extensions they'd like to use. Adding flexibility on this naturally leads to a bigger feature matrix. Of course, the toolkits are also free to drop support for X servers that don't have those extensions, which in turn would shrink the X11 backend. I have no doubt that in 30 years, they'll have a similarly-sized feature matrix for all the Wayland extensions they'll want to support.
- cycloptic 6y agoOr perhaps by then we will have moved onto another protocol that's even simpler.
- jude- 6y agoBetter idea: fix the bad life choices that got us to this point, so we don't have to keep re-living them. What a concept!
- cycloptic 6y agoI think we would all love it if we could magically fix every bug or design flaw in existence with a wave of the hand, unfortunately in real life it takes time and experience to do things right.
- kaba0 6y agoWhat complexity? I have written both a simple wayland client and server — both are simple lib calls. Also, how often do you write gui apps without any framework? It is absolutely hidden away in both gtk and qt apps.
- sprash 6y ago> What complexity? What is a wl_registry_listener and why do I need it? What is a simple XGetImage() equivalent on Wayland? On Xlib function names at least give you an idea about what they are supposed to be doing. > Also, how often do you write gui apps without any framework? As soon as you have a Toolkit you don't need Wayland anymore. Windows then are just additional nodes in the object tree. There was even a demonstration of GTK applications running in a framebuffer without X11 way before Wayland even existed. If Wayland can only be used sanely with toolkits it indeed is completely pointless.
- kaba0 6y agoIt was some time ago I looked into it, but wl_registry_listener registers a callback for when the compositor “declares” what protocol extensions it supports. This is painfully missing from X, but this makes Wayland much more modular/extensibly. Wayland’s abstraction is basically a buffer. The client simply creates a buffer either in shared memory, or directly on the GPU and then passes the compositor a handle to the buffer. That’s it. Also, it is sort of ingenious to compare the two — the XLib is a higher level lib than libwayland. There is absolutely no reason why someone could not create a wrapper for this — although I again ask, how often does one create an only X/only Wayland window without a framework.
- cycloptic 6y agoWayland doesn't have the equivalent of XGetImage for various reasons, but screen capture applications can use the ScreenCast flatpak portal to select window sources: https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-method-org-freedesktop-portal-ScreenCast.SelectSources https://flatpak.github.io/xdg-desktop-portal/portal-docs.htm... I am not sure what you mean by Wayland can only be used sanely with toolkits, any GUI usually need a toolkit or some equivalent, even under X. if you are not using a pre-existing toolkit and are writing your own routines to draw buttons and text boxes and such, that would be implementing your own toolkit.