245 points · by luigifcruz · 5y ago · 295 comments
Using Qt apps under Gnome on Wayland can break in weird ways (e.g. in one case I saw popup menus opening in weird places or disappearing entirely). Meanwhile, because window decorations under Gnome are client side, the behaviour is weird and inconsistent (double-click on a Gnome titlebar and it maximizes, but double click on a Qt app titlebar and it doesn't).
So maybe switch to KDE? Unfortunately, the idea of a "primary" display simply doesn't exist in KDE on Wayland, which is a major regression for multi-monitor setups. And that's setting aside that KDE on Wayland still crashes on a very regular basis.
Under Gnome I've also seen apps like Guake that simply don't work properly due to either bugs in the compositor or limitations in the Wayland protocol (I'm still not sure which), so you need to find workarounds in those cases.
In general this leads to distros not enabling Wayland by default in clients and toolkits, even if Wayland is the default display server. For example, on Debian (testing), both Firefox and QT require special environment variables to be set depending on your setup. If you don't set them, those applications just use Xwayland and you lose things like fractional scaling. Force the use of Wayland and you end up with a lot of the issues I mention above.
Wayland is really coming along. When it works, it's smooth as butter and works great! Heck, I'd love to use it if only for fractional scaling support. But a lot of things are still very broken and it's still gonna take a while for things to mature.
The main issues I encounter are about screen sharing. At the moment it does not work for wayland apps (i.e. wayland apps don't show up in the share this). Supposedly there is a way around it, but I've not yet needed to investigate. The other issue is OBS not working (I guess also because of screensharing). And the third issue is some weird bug in Zoom, where if I open the participant or chat window, it becomes extremely laggy. So much so that I can't really type in the chat window because there is such a strong lag, that I finished typing before the word appears. Similarly the video feed becomes choppy.
One other issue was that Pycharm was having issue opening some menus/windows but that seems to have been fixed now.
I actually listed a range of issues. Some are in Gnome. Others are in KDE. Yet others are in the toolkits (e.g. the Qt popup menu problem). And still others are in the applications themselves (e.g. Firefox has a whole menu of Wayland-specific bugs).
Definitely a Gnome issue.
I don't care for "smooth" or "every pixel is perfect" so to me the trade-offs are all negative.
https://github.com/swaywm/wlroots/wiki/Projects-which-use-wl...
As a happy Openbox user, I'm planning on trying Waybox first I think. Waiting for the next Debian release though.
The very conservative nature of Ubuntu packaging really holds back things getting fixed in my opinion. It’s hard to have a feedback loop when the biggest desktop distro ends up being super far behind. I get why but I would love an opt-in “rolling release” repo for Ubuntu, as silly as that seems
Same on sway. I think the relevant bug report is this [1] but there is no traction and the patch doesn't really work. Qt5 is probably not going to receive any attention now too, so I'm not holding my breath.
Upd: well, that problem doesn't seem to be fixed there, still no constraints are set on the kde/5.15 branch
You could put different windows on particular screens or just punt everything to the desired primary monitor.
This functionally is also available in i3wm/sway as for_window and as a stand alone application under x called devilspie2.
The idea is that things like the status bar, top bar, dock, etc, appear on the primary monitor unless configured otherwise.
Similarly, new windows preferentially open on the primary monitor.
This is existing functionality on all of these desktop environments.
In a multi-monitor setup, you designate a monitor as the primary monitor and the desktop automatically "does the right thing" even if you remove and reattach the primary display.
KDE on Wayland loses this functionality. The primary monitor is whichever monitor is detected first with no way to control it through configuration. The only workaround is to disable your secondary screen and then re-enable it, and you have to do that every time the desktop launches or the display configuration changes, which is a deal-breaker if you dock/undock regularly (or when the display server crashes).
Might there be hacky workarounds that partially fix some of these issues? Maybe. But it's a major functional regression and I'm not willing to invest that effort (especially, again, given the stability issues).
BTW, Gnome on Wayland preserves this functionality. But unfortunately, as I mentioned, Qt + Gnome leads to a whole host of other issues.
Come on, Wayland was released 12 years ago! And it still has all kinds of problems that don't make it qualify even for beta software. I'm highly skeptical that Wayland will ever be as useful as X11 is right now.
Wayland, itself, is just a protocol. The display servers are just the display servers. But then you have Gtk and Gnome, Qt and KDE, software like Firefox and Chrome, etc. All of those have to updated as well, and while Wayland the protocol, the display servers, and a lot of the suite of infrastructure around it is in pretty good shape, the toolkits and clients and so forth all still need a lot of work.
And you only need to look at the Python 3 transition to see how hard it is to shift a whole ecosystem.
So I'm willing to cut the Wayland guys some slack. But it does mean there's still a ways to go, yet, before things are ready for prime time.
Ubuntu desktop, default desktop and config.
Because Linux desktop is already fringe. If you use uncommon options on a fringe OS, you're going to spend lots of time debugging problems. I just like my tools to work.
I'll be sticking with X11 until wayland becomes the default in some future LTS release.
I have read of the supposed benefits of Wayland, but from what I can percieve, the cons (too numerous to mention, but mostly breaking a billion useful things that X has had for some time) seem to out weigh the pro. Yes, the pro. Fractional scaling.
I don't like actively cheering for something to fail, but I really don't get it. X11 is in no way broken enough to justify such a huge change, and I'm concerned that the KDEs and Gnomes of the world are going to ramrod the thing through regardless.
Mostly the issues could be hacked around. But let’s be absolutely clear with this: it is hacking around the issue.
Problem: tearing, solvable with double buffering, maybe.
Problem: Xorg runs as root, solvable, there’s ways of making your user have direct control of the frame buffer device.
Problem: Xorg is a network system, and a porous one, meaning it’s possible to intercept keystrokes from any running program. Solvable by running a mini X11 instance for each program.
Problem: Xorg is a network system, meaning it is very inefficient. (Imagine using TCP to talk to your SSD)
Problem: Xorg needs to be backwards compatible, so it can’t dig much into hardware features. Especially as the client may not be on the same machine as the server.
Overall, wayland is a good clean slate, it’s been in development a long time. X11 has major warts and they are hard to clear out.
The “good old days” of unencrypted Internet, where everyone could see your cookies, are no longer acceptable; the same is true of X11.
With X11, if you copy a password from your manager, you must assume all running apps now know it and transmitted it to a malicious server. There’s no way to tell.
With Wayland, it is only transmitted upon pasting, and only done directly from the copier app to the paster app.
With X11, everything displayed on the screen is compromised. Also, all inputs, keyboard and otherwise.
With Wayland, each app only sees their own pixels.
With X11, screen locking is pure hackery that doesn’t always protect the locked pixels and… login password.
Traditionally, you are meant to trust that process boundaries on Linux are sacredly secure, which is why Spectre was a big deal. But in practice, that is only true under Wayland.
With Wayland, it is only transmitted upon pasting, and only done directly from the copier app to the paster app.
Can you elaborate?
This sounds implausible, wishful thinking since key bindings are managed by individual applications. Whoever holds the clipboard must trust the application that claims to have received a paste command from the user. I don't see anything that could prevent spoofing without just blocking clipboard access entirely or making the usability a lot worse.
”With Wayland, each app only sees their own pixels.”
Out of curiosity, if this is true, how are screenshots / screen recorders implemented? Do they require some special permissions? And if this is the case, why wouldn’t any app be able to acquire these special permissions?
I don't care if xorg runs as root and I don't need to run an instance of xorg per application I simply install software from trusted sources and haven't managed to get malware between 2003 and now. I also didn't have issues with tearing in 2003 and I don't now.
Generally speaking QT and GTK and other toolkits must concern themselves with the details of X others concern themselves with QT or GTK as they would under wayland. It is extremely likely that all players in the overall ecosystem who never had to specifically worry about X in many years have had more issues, work, and tears from wayland development than they would have had for the remainder of the next century with X.
This is nearly entirely about presenting a saner stable base to improve the work for a tiny number of people actually developing the graphics stack in Linux to build upon and unfortunately they made poor design decisions at the start that have led to it taking 12 years and still not being ready for prime time in some ways.
After doing the necessary research to understand the topic you could construct another post about the shortcomings of X that is actually factually correct but it would still be beside the point. Wayland would still be a poor work that squandered a lot of the opportunity of a clean slate despite its authors being in perhaps the best position possible to do so. In 20 years Linux if it exists on the desktop will be a weird opaque overengineered system that works when it works and is impossible for an end user to understand why it is misbehaving when it doesn't.
On the bright side due to package management the windows solution of pave over the install and start over could probably be configured to automatically reinstall all your software for you!
You're not using TCP for local X, it's all Unix domain sockets and SHM. Hard to get any faster on Linux.
One could certainly implement feature emulation to preserve backward compatibility with evolving hardware. Or just deprecate feature, X over network was pretty much broken for a long time.
Not saying Wayland isn't an improvement over X but a lot of supposed limitations of X are often misrepresented and exaggerated.
> Overall, wayland is a good clean slate, it’s been in development a long time. X11 has major warts and they are hard to clear out.
This may seem like it's irrelevant for the user. It isn't. Lots of things us users want are much easier and more attractive for developers to add to the clean slate design that is Wayland.
For example: When I switched, an unexpected bonus I experienced was that my touchpad's behavior got orders of magnitude better. So I googled around a bit, and it turns out that almost all touchpad improvements just happen to occur on Wayland because the people who are interested in that aren't interested in wading through the X swamp in order to implement their stuff. (I mean, have you looked at the X code? Oh dear, oh dear, it's a daunting thing!)
This is something I don't understand about Wayland. How is it possible that something that is supposed to be much easier and more attractive for developers after TEN+ years of development still has so many issues ?
I am quite sure that there is something wrong with your system if your X clients run through the IP stack by default.
I'm running Openbox/Xubuntu on a 4K monitor, doing some awesome equivalent-of-4-monitors work, then playing all the steam games I want with the Proton and the decent AMD GPU, all under X. "Font size is a little weird sometimes" is my only gripe?
Put differently, I understand "hacking around the issue" criticism in theory -- but if you applied that sort of purity to, say, web programming -- step one would be, okay, first get rid of Javascript, an idea that I really do like in theory, but I know it's not happening.
I've never even had a reason to want to run it.
But I'm sure it'll be great, any day now.
So? The same has been the case for desktop Linux in general, for 2 decades.
And also perfectly possible with X11 because the pitch information is exposed via the Xrandr extention
> Problem: tearing, solvable with double buffering, maybe.
Solved since ages. Just enable Tearfree in your Xorg.conf. That also shows how great X11 really is. It allows you the choice to turn it on or off. Because Tearfree comes at a cost of latency.
> Problem: Xorg runs as root, solvable, there’s ways of making your user have direct control of the frame buffer device.
OpneBSD solved that two decades ago. Also it perfectly possible on Linux to run X11 as non-Root.
> Problem: Xorg is a network system, and a porous one, meaning it’s possible to intercept keystrokes from any running program.
This is a feature not a bug. The security paradigm is blacklisting (which means sandboxing untrusted apps) instead of whitelising (which means locking everything up and only allow the compositor to do stuff). Since the vast majority of Software on FOSS system is trusted X11 is the far superior solution here.
> Problem: Xorg is a network system, meaning it is very inefficient.
X11 runs even on 386's and beats Wayland in every performance metric, especially latency. After 13 years of development only some compositors come close to X11's performance.
> Problem: Xorg needs to be backwards compatible, so it can’t dig much into hardware features.
Backwards compatibility is a major feature even 40 year old Software runs on current Xorg which is an impressive feat. As for the "hardware features": DRI3 uses the exact same buffer sharing mechanism as the major Wayland compositors do. Wayland offers zero advantage in exploited Hardware features. On the contrary X11 is capable of using hardware layers that has the effect that you can smoothly move your mouse even on heavy load and OOM events. Wayland still completely craps out in that regard.
> Overall, wayland is a good clean slate, it’s been in development a long time.
It is a clean slate, but a very bad one. The wrong philosophy ("every frame is perfect") and the wrong abstractions ("everything in the universe is a buffer made of RGB values") make it a major step backwards in computer graphics on Unix/Linux.
Only the "Windows" kind of scaling where the app works in non-scaled, real pixels and does everything by itself. Not the "Apple" kind of scaling that Wayland supports, where you have logical pixels backed by 2x/3x/… the physical pixels. (Like many things Apple does, this was invented for good reasons. Positioning a window to be on both a 1x and a 2x monitor just works with that kind of scaling, without the app ever having to consider the displays it touches.)
> Solved since ages. Just enable Tearfree in your Xorg.conf.
That's a driver-specific hack that kinda maybe works sometimes. Sometimes you need to juggle compositor options combined with that and nothing works anyway.
> X11 runs even on 386's and beats Wayland in every performance metric, especially latency.
Any composited X11 desktop is slower than a Wayland one, with the Xorg server acting as a bloated IPC broker in between the compositor and the client.
Yeah, you can get really low latency if you just don't composite at all. Go back to Windows 95 if you think that's acceptable :)
> X11 is capable of using hardware layers that has the effect that you can smoothly move your mouse even on heavy load and OOM events. Wayland still completely craps out in that regard.
I'm sure pretty much all production Wayland compositors use the cursor layer. wlroots for sure does. (But I don't think it's a big deal under heavy load, there the problem is the display server even processing the mouse events at all first.)
Weston goes further and can use HW layers for actual surface compositing when possible. wlroots is going to gain that power soon-ish with libliftoff.
> The wrong philosophy ("every frame is perfect")
Again, feel free to use Windows 95.
For anyone used to current commercial desktop and mobile UIs, any imperfect frames are unacceptable, artifacts like tearing make your system look like a complete joke. Apple computers didn't show imperfect frames since the early early 2000s PowerPC era. Not matching that is a complete shame.
This is absolutely not a good solution. Even if you audited all your software enough to consider it trusted (which is unlikely if you're not a purist - see IDEs, browsers, widevine, Docker ...), it does not guarantee anything is secure. Anything that receives input from the outside might be vulnerable to an RCE. If you're running it under a different user or in a jail, the impact is limited - unless it can access your X server, in which case it can simply log everything you type and escalate.
Jailing an app is basically impossible under X. Yes, you can use Zephyr, but you're not going to be able to watch a video there and you're WM integration is going to be miserable as well. And realistically you'd really need to jail most apps.
X11 might work for a lot of things, but blacklisting is absolutely not a superior approach.
There will be stumbling blocks as with any new technology, especially one that interrelates with so many systems but Waylands core architecture seems to be solid.
Personally, I’m still using I3 and don’t see many immediate benefits to switching over to Sway (the Wayland fork of I3). I am cheering Wayland on though and making the switch is somewhere on my todo list. What other path forward is there for desktop Linux?
Minor clarification: Sway is an i3-compatible wayland compositor written from scratch, not a fork.
If everything that uses X11 today can be used on top of XWayland without any modification and without performance loss, this means that a lot of pressure stemming from the need to switch to speaking Wayland instead of X11 is lifted in a certain sense.
Or am I missing something?
Oh it absolutely is. The entire design of X11 is broken and a barrier to how applications & drivers actually work.
There's a reason that literally everyone else switched away from an X11-style model to a Wayland-style one. That is, MacOS, Windows & Android are all Wayland-style compositor designs. This was the major transition that Microsoft did from Windows XP to Windows Vista.
This is part of the reason that things like video playback in browsers on Linux is just awful. What browsers (or really any modern UI stack) want is just a system compositor that speaks buffers and transactions. Transactions are important to synchronize composition changes and content changes - for example, when you scroll a webpage with a video in it. It's better for power if the video is in a system composition layer, as then it can use a hardware overlay plane instead of being GPU composited (reduces power consumption). But then you need the browsers updated rendering of the scroll position to be synchronized with that composition update. This type of capability is standard on all major platforms at this point.
You can do this everywhere, except on X11. Possibly doable with extensions, but at that point your "extensions" are "completely change everything about the base X11 design & promises" as X11's base design & promises specifically don't provide anything like this.
X11's fundamental design is completely wrong & backwards. That's why a clean slate is necessary. Yes this migration is painful (see Windows Vista), but if it was actually pushed it would be a short term pain and the ecosystem would come out the other side healthier than it started (see Windows 7)
And why do you think you have sufficient knowledge on the topic to assume that? I do assume you have not read the source code of the X server, isn’t it a bit “cocky” to state such a statement, which is in opposition to what the actual X maintainers say, who actually created wayland? It’s not like a project from nothing, it was created with the shortcomings of X in mind.
[citation needed]
This is always the case when there is some widely used legacy tech, but it shouldn't stop us from trying to move forward, or we'll never get better things.
I've personally switched to using wayland on my main laptop and am very happy with it. I was using X before and was getting incredibly bad screen tearing when using i3, I tried every recommendation I could find (double buffering, running a compositor, etc) and nothing helped, but Sway on wayland fixed it for me and its been running flawlessly for the last 9 months. I have no plans of going back to X anytime. The only thing I use X for is playing Windows games with Proton (which this HW acceleration change might even fix, if the laptop had an nvidia gpu, but alas, it does not).
Wayland means moving backwards. It has the complete wrong philosophy and abstractions. If "sway" runs flawlessly for you you are not doing much with your computer at all. I can't work without my fine tuned synaptics driver configuration and without my over the years grown and perfected scripts using xdotool, dmenu, xsel, xcape, xcalib and many other tiny but useful x-tools.
> fine tuned synaptics driver configuration
My touchpad, touchscreen and apple magic trackpad work great for me, so this isn't a problem for me.
If message boards like HN are where you're getting this impression, just beware of sample bias. Remember that everyone on Fedora and/or KDE has been running wayland for literal years. That is a lot of users, and not enough complaints to make them consider reverting.
Fwiw here's my counter anecdata:
I'm on arch with swaywm, meaning my system is in no way "out of the box". I have gone back to X from time to time, and... it drives me crazy. Everything is blurry, it takes an hour off my battery time, and it FEELS laggy and unresponsive. Oh, and the experience of installing anything involves 5 extra packages (automatically included, at least) to work around X stuff. God help you if you want to configure an input method; it goes through AT LEAST 2 layers. For some input methods (touchscreens, i'm looking at you), you have brittle hacks like one layer is just reading the debug log of another. Anyway every settings change you make requires restarting your whole WM, and probably fiddling with several 3rd party tools to understand and make it easier... no thanks.
Even when I could only screen share between xwayland apps, and I really tried to go back, I couldn't stomach it. The wayland experience for me is just so much better across so many dimensions. I can only imagine what it's like for my friends who use OOTB setups and aren't even aware they're on Wayland.
A conservative rewrite, that amends those things experience has shown were mistakes but were always retained for compatibility, is rare, since the impulse to rewrite is revolutionary in nature. A rewrite is treated as an opportunity to remake the world in a new image (with a new set of mistakes to uncover).
It needn't be a prompt users will quickly be prompted to click yes to it could easily be an option in settings or at communicated at install time.
Wayland is a necessary part of security, but not sufficient.
Second, it ended a pile of hacks upon hacks.
Those two reasons have to be added on top of the other benefits of Wayland (or any other modern re-arch of X).
Nvidia still have some way to go with their driver policy, but them contributing in an attempt to become a normal citizen of the Linux ecosystem is a sign that the "fuck you" days may finally be coming to an end which, as the owner of a laptop with an Nvidia chip, gives me a sense of relief.
As far as I know this is all still based on their non-standard EGLstreams platform, but they are working on a Vulkan allocator that supposedly fixes the issue and some contribution activity indicates that they may finally support GBM, which would make Nvidia cards "just work" without any special treatment, which I would of course prefer.
EGLStreams is the actual Khronos standard (https://www.khronos.org/egl) as such existing on Windows, QNX and others.
That being said, I'm now enjoying wayland. Gnome apps already supports wayland natively. The rendering is smooth, no tearing and no issues. I think the transition to Wayland will be faster than many here are predicting.
Haven't compared it against windows, because haven't felt the need. I'm sure some functionality/perf is missing though.
Your 6700 XT might not be fully supported, but my 5500 XT is and was been causing kernel panics since I bought it one year ago. I got tired of posting the same drm bug report as reference but it's one of the 3 most commented and open for a couple years now.
It's painfully obvious that the Linux driver team at NVIDIA is underbudgeted and completely ignored, so I'm happy Wayland comes for them as well and I can continue to use their high end cards and not be relegated to tried-and-tested-and-painfully-old AMD cards on Linux, at least until they sort their day 1 support for new cards.
I had thought Wayland was not ever likely to be supported by nVidia, but something clearly has changed.
Wayland can't possibly replace X11, it's got a fundamentally different (I'd even say broken or even malicious) design. If anything, some Wayland compositors may emerge as dominant desktop environments, but this would be a dark day for power users, if it would mean not being able to switch to an actually friendly design, as currently offered by Xorg.
Unfortunately due to the misdesign of Wayland each graphical environment must write code to more directly interface with hardware instead of that being a layer above that. This means in current context it is vastly easier if NVIDIA bends on this issue however they also have the least incentive because most of their money isn't earned on the Linux Desktop.
People seem to suppose that somehow hardware vendors owe Linux users support and support in the fashion that would be desirable as if somehow not supporting the standards that others do is somehow wronging those developers and users but a private company in fact doesn't owe said developers or users ANY support of any kind.
Intel and AMD, the arch-rivals they are, coexist and collaborate on the kernel stack and Mesa. Even embedded companies join in (see Broadcom hiring Eric Anholt to make V3D a thing for the RPi4, even Qualcomm vaguely supporting Freedreno and Arm starting to show some kind of interest in Panfrost IIRC). Microsoft is in for virtualization and GL-on-D3D.
None of these vendors "owe anybody anything" yet they've joined the party. Turns out sharing is beneficial for everyone.
It has nothing to do with wayland, it is due to linux not wanting to provide a stable API for drivers, deterring binary blobs (successfully). As for whether this latter thing is good or bad is subjective.
I'm asking because it seems like no one relying on Nvidia card for number crushing and who want Wayland seem to have opted to just get a second card.
It seems that Nvidia finally is moving away from the GBM madness.
One would think that A. D. 2021 a program implementing one abstraction upon another abstraction wouldn’t have to care about the actual hardware it’s running on.
But in the actual fact we have GUI programs containing quirks for graphic chips, and userland programs deeply concerned with what kind of filesystem they are writing to.
https://www.phoronix.com/scan.php?page=news_item&px=Xserver-...
Is that true?
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/m...
On NVIDIA/Windows, the recommended setting for lowest latency is VSYNC+GSYNC enabled.
https://blurbusters.com/gsync/gsync101-input-lag-tests-and-s...
I spent the whole Friday evening and night trying to figure out, why my Mouse does not work plugged into a USB port on my Thunderbolt 3 Dock connected to my laptop with a Nvidia GPU.
Turns out it was Nvidia’s driver fault all along. This happened now so often to me, that for the next times I will just always first look whether the Nvidia driver has some bug, before I try to figure out something myself.
The most likely answer is next version or the one after that depending on how they'll do the release (Ubuntu just released so there are a few months available for the next version in their 6 months schedule, it'll definitely be in the next LTS).
Source: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests...