News for hackers. Stuff that matters.
Re:Improving Xwayland window resizing by porphyra on Monday October 28, 2024 @06:26PM (#41977138)
Linux desktop is full of such jank. Fortunately, thanks to contributors like OP, the jank is gradually getting fixed. The whole point of Wayland is to eliminate a whole class of jank (screen tearing) that was essentially unfixable with X.
Re:Improving Xwayland window resizing by o11c on Monday October 28, 2024 @06:49PM (#41977371)
And yet, empirically, jank is far more common on Wayland than X11. With X11, on the rare case I noticed, it was usually just a matter of "okay, which toolkit or driver do I need to look up the vsync environment variable for?"

I have no opposition to Wayland in theory; my concerns are entirely practical and unignorable.

Re:Improving Xwayland window resizing by porphyra on Monday October 28, 2024 @07:39PM (#41977778)
Yeah I have experienced all sorts of flickering and artifacts on Wayland, especially on nvidia. Recently it has gotten a lot better though.
Re:Improving Xwayland window resizing by seba_dos1 on Monday October 28, 2024 @08:46PM (#41978214)
FWIW, Nvidia problems on Wayland were Nvidia's problems, not Wayland's. Wayland was just a victim of Nvidia's bugs and lacking implementations.
Re:Improving Xwayland window resizing by p_l on Monday October 28, 2024 @09:12PM (#41978357)
Except for tearing, which turned out to be a combination of Mesa/DRM bugs and Wayland naively assuming the behaviour of those bugs.

Then nVidia decided to switch to GBM/EGL way of doing things and it turned out everyone had incorrect assumptions...

Re:Improving Xwayland window resizing by pmontra on Tuesday October 29, 2024 @02:47AM (#41980103)
You mean this https://www.phoronix.com/news/NVIDIA-EGL-Wayland-1.15 and the multy year story that I can guess from the comments in there?
Re:Improving Xwayland window resizing by p_l on Tuesday October 29, 2024 @04:13AM (#41980779)
Explicit Sync, yes. The reason why I consider previous implicit sync a bug is that it was essentially unfounded expectation - nothing guaranteed you'd get a magic mutex in the sky that synchronized renders for you, and in fact, you do not want one for maximum performance. Lack of explicit sync also essentially meant common multi-gpu setups would be broken.
Re:Improving Xwayland window resizing by ChocolateGod on Tuesday October 29, 2024 @05:29AM (#41981342)
Androids graphics stack and drivers also use explicit sync, it isn't just a Nvidia thing.
Re:Improving Xwayland window resizing by p_l on Tuesday October 29, 2024 @07:50AM (#41982913)
I was not saying it's an nvidia thing, just that significant majority of devices used by wayland proponents had undeclared implicit sync issues that were invalidated when faced with a driver that didn't have them.
Re:Improving Xwayland window resizing by seba_dos1 on Tuesday October 29, 2024 @10:33PM (#41991425)
I don't think that's an honest representation of what happened. Wayland relied on implicit sync by design, it wasn't "a bug" but a choice. The fact that in the end there were valid reasons to start moving towards explicit sync besides of lacking Nvidia implementation is irrelevant to the fact that Nvidia did not implement a correct driver for the existing requirements of the platform.
Re:Improving Xwayland window resizing by p_l on Tuesday October 29, 2024 @11:02PM (#41991595)
It relied on implicit sync as far as I know by accident. But since it worked for the popular configuration, no one dug deeper that support for accelerated drawing without multi-frame lag of manually calling commit on surfaces had gaps in design.
Re:Improving Xwayland window resizing by seba_dos1 on Wednesday October 30, 2024 @05:02AM (#41993071)
Implicit sync worked by design. There were years of discussions whether it's a good idea to rely on it and how exactly explicit sync would actually look like, with protocols such as zwp_linux_explicit_synchronization_v1 (eventually deprecated) being worked on almost a decade ago already, but it's definitely not an "accident". Explicit sync offers several advantages, but implicit sync is how DRM was designed and what Wayland consciously relied on, and what Nvidia disregarded because it would be rather challenging to implement it in their driver.

The ecosystem slowly moves towards explicit sync now, but Nvidia was supposed to provide a driver already before that was happening and they didn't comply with platform's requirements at date, resulting in user-facing issues. With this one, they just got lucky that the consensus happens to move towards what they had already asserted.

Re:Improving Xwayland window resizing by talldayo on Monday October 28, 2024 @08:39PM (#41978184)
> And yet, empirically, jank is far more common on Wayland than X11

It depends on the type of jank you're talking about. It's wholly disingenuous to characterize Wayland as janky but x11 as not - the jank inherent to x11 is what made the original Xorg developers start making Wayland in the first place. Empirically, if x11 was perfectly fine there would be no motivation to design a successor.

x11 gets the first-mover advantage of a lot of implementations and a straightforward design goal, but that's about it. It's not secure enough to recommend as a serious alternative to Mac and Windows users, and it's too slow and unopinionated to present a friendly face to new users. Features like 1:1 trackpad gestures, genuine HDR pipelines and a locked compositor framerate are all getting to the point that regular consumers expect them as default.

If you want to keep using x11, it's unlikely someone is going to take it away from you. But it's on track for depreciation and hasn't been actively developed in years. Recommending it as a panacea to new users is a bad idea.

Re:Improving Xwayland window resizing by FeepingCreature on Tuesday October 29, 2024 @02:08AM (#41979910)
> x11 gets the first-mover advantage of a lot of implementations and a straightforward design goal, but that's about it. It's not secure enough to recommend as a serious alternative to Mac and Windows users, and it's too slow and unopinionated to present a friendly face to new users.

I've been recommending it as a serious alternative for years, and it's always presented a friendly face.

> Features like 1:1 trackpad gestures, genuine HDR pipelines and a locked compositor framerate are all getting to the point that regular consumers expect them as default.

I have never heard anyone not already a Linux user comment on even one of those as a problem.

Re:Improving Xwayland window resizing by Arainach on Tuesday October 29, 2024 @02:38AM (#41980057)
>I have never heard anyone not already a Linux user comment on even one of those as a problem

....because Windows and Mac users have not had these problems since 2006?

Re:Improving Xwayland window resizing by lupusreal on Tuesday October 29, 2024 @06:08AM (#41981912)
That's not what he said.
Re:Improving Xwayland window resizing by orangeboats on Tuesday October 29, 2024 @06:31AM (#41982198)
>I have never heard anyone not already a Linux user comment on even one of those as a problem.

Those specific words are uttered by Linux users, true. However, Linux beginners _do_ notice some X11 issues, it's just that very frequently they only know "something" is off but not why they feel so.

From anecdotal experience, touchpad gestures are actually something my friend complained so YMMV. We ended up making a file in /etc/X11/xorg.conf.d/ to configure the synaptics driver. Another experience had to do with screen tearing, I helped them fix it by installing a compositor.

Re:Improving Xwayland window resizing by FeepingCreature on Tuesday October 29, 2024 @11:42AM (#41985226)
To be fair, my anecdotal coworker evidence with Wayland has been "the Webex client doesn't work" with the ten-second remedy of showing them how to set their default desktop back to X11.
Re:Improving Xwayland window resizing by orangeboats on Tuesday October 29, 2024 @01:17PM (#41986883)
That only tells us X11 has a first-mover advantage. Wayland supports screencasting too.
Re:Improving Xwayland window resizing by lupusreal on Tuesday October 29, 2024 @06:06AM (#41981891)
> It's not secure enough to recommend as a serious alternative to Mac and Windows users

The security risk of X11 is theoretical, not practical. Yes, X11 programs can maliciously keylog each other, but this just isn't a thing that actually happens. And even if you do start installing random malware from the internet like a classic windows user, Wayland isn't going to prevent you from screwing yourself anyway. To actually be safe while installing and running malicious applications you need extensive sandboxing. Wayland can be one part of that sandboxing but is useless without the rest (to prevent the malware from stealing user files including credentials, using LD_PRELOAD hacks or similar to keylog other applications anyway, etc), and no distro suitable for recommending to Windows/MacOS newbs has the rest of the requisite sandboxing. The sandboxing touted by Wayland advocates is very esoteric and without all that sandboxing, a newb using Wayland has to exercise just as much caution when downloading software as if he were using X11.

Re:Improving Xwayland window resizing by orangeboats on Tuesday October 29, 2024 @06:24AM (#41982128)
> Yes, X11 programs can maliciously keylog each other, but this just isn't a thing that actually happens.

A simple search leads me to this: https://github.com/anko/xkbcat

There isn't a real attack using it yet, only because attacking Desktop Linux is a really unprofitable endeavor (considering the marketshare, the ROI must be very low).

> To actually be safe while installing and running malicious applications you need extensive sandboxing

FWIW, X11 is unsandboxable unless you run a second X server on top of your current server [0]. Which is fine, but you need to consider that most, if not all sandboxing solutions on Linux that "newbs" use, like Flatpak, do not employ such technique when running sandboxed X11 applications.

The "security by default" behavior of Wayland limits the possible attack surface a lot, without requiring the end user to understand all the nitty details involved.

[0]: https://wiki.archlinux.org/title/Bubblewrap#Sandboxing_X11

Re:Improving Xwayland window resizing by lupusreal on Tuesday October 29, 2024 @09:42AM (#41983761)
You're not telling me anything I don't already know and haven't already explained. X11 keyloggers are trivial, and virtually never seen in the wild. X11 makes sandboxing impossible, but that doesn't matter because I'm not going to waste my time on something like Qubes anyway, and newbs from Windows aren't being directed to setups like that either. They're all installing Mint or Ubuntu where the security of Wayland is nullified by the absense of sandboxing.
Re:Improving Xwayland window resizing by orangeboats on Tuesday October 29, 2024 @10:24AM (#41984144)
>newbs from Windows aren't being directed to setups like that either. They're all installing Mint or Ubuntu where the security of Wayland is nullified by the absense of sandboxing.

This cannot be more further from the truth. Amongst the newcomers, it is rather popular nowadays for them to use Flatpak-bundled apps, especially with the rise of SteamOS (the Deck essentially) lots of Linux newcomers are in fact first exposed to Flatpak and running untrusted executables in a sandbox.

And the most prominent "untrusted executable" today to those newcomers has to be Bottles, which is a nice GUI wrapper for Wine and is sandboxed (if you enable wine-wayland, of course).

Re:Improving Xwayland window resizing by asveikau on Tuesday October 29, 2024 @11:03AM (#41984558)
I wouldn't trust flatpak enough to run a truly untrusted executable. I am sure flatpak's isolation is full of holes unrelated to windowing.

But I don't think a game purchased through steam counts as untrusted.

Re:Improving Xwayland window resizing by orangeboats on Tuesday October 29, 2024 @01:08PM (#41986736)
>I wouldn't trust flatpak enough to run a truly untrusted executable. I am sure flatpak's isolation is full of holes unrelated to windowing.

As compared to running untrusted programs completely naked?

>But I don't think a game purchased through steam counts as untrusted.

Bottles is there for people to run any Win32 program, not just Steam games. And I shouldn't have to tell you how many malicious Win32 programs there are.

Re:Improving Xwayland window resizing by asveikau on Tuesday October 29, 2024 @01:56PM (#41987451)
Just google the criticisms of flatpak from a security perspective. They're out there.

Containerization on Linux was never intended to be a security feature for totally untrusted, malicious code. It's isolation for trusted code. If your scenario relies on securely running untrusted executables in a Linux container you are doing stupid things.

Re:Improving Xwayland window resizing by orangeboats on Tuesday October 29, 2024 @02:42PM (#41987953)
I am well aware of the weak points of Flatpak. But are you suggesting that running applications in a container is not more secure than running an executable completely naked?

You see: If you want absolute security, for sure, go for a full-fledged VM! Or run something like QubesOS. It is a completely reasonable decision.

However, malice certainly has degrees, and the "mildly malicious" programs most likely cannot take advantage of sandbox escaping exploits. If Flatpak can stop 95% of all attacks (relative to running a program completely without sandboxing), that is already a win in my book.

But I will note again that X11 is a big hole (as in, almost a complete free-for-all) for sandbox escaping in Flatpak.

Re:Improving Xwayland window resizing by asveikau on Tuesday October 29, 2024 @03:00PM (#41988137)
You seem to think a lot of things that aren't security boundaries are security boundaries. There have been VM escapes too. VMs are not for running untrusted OS images you get from end users.

I'm done with this thread, have a nice day.

Re:Improving Xwayland window resizing by lupusreal on Tuesday October 29, 2024 @12:03PM (#41985607)
Has there ever been a single instance of a game from Steam including an X11 keyloggers? These threats are off in fantasy land.
Re:Improving Xwayland window resizing by orangeboats on Tuesday October 29, 2024 @01:12PM (#41986808)
I am not sure where you got the impression of me talking about only "Steam games". Bottles allows you to run any Win32.

And besides that, "these threats are off in fantasy land" is an invalid defense in my opinion, considering the (quite sophisticated) XZ Utils backdoor happened not too long ago! Like I said, if such an attack towards X11 hasn't been deployed in the wild, it can only suggest such endeavor is unprofitable, not because the threats are fantastical.

Re:Improving Xwayland window resizing by lupusreal on Tuesday October 29, 2024 @06:11PM (#41989958)
XZ utils backdoor could have exploited X11, but didn't. And the most common Wayland configurations wouldn't have protected people from the backdoored utility; only extremely paranoid and therefore esoteric setups might have.
Re:Improving Xwayland window resizing by orangeboats on Thursday October 31, 2024 @02:46AM (#42004092)
> And the most common Wayland configurations wouldn't have protected people from the backdoored utility

If the attacker decided to backdoor an utility and make use of X11, it is most likely the backdoored utility will listen to keyboard events, read the bitmaps of other X11 clients.

And there's nothing that can stop the backdoor from doing so on X11...

Anyways, if you are saying the Wayland security policies are unneeded because there hasn't been an attack on X11 (this is the fundamental disagreement between us), consider the following: You don't install doors in your premise, because there hasn't been a case of burglary in your neighborhood?

Re:Improving Xwayland window resizing by funcDropShadow on Tuesday October 29, 2024 @11:37AM (#41985098)
Why is X11 unsandboxable? A similar but reverse approach to Xwayland, something like waylandX could be used to be part of the overall sandbox approach to run untrusted applications. That would have the advantage that the severe restrictions and feature degradations of wayland are only applied to those untrusted sandboxed applications, not everything.
Re:Improving Xwayland window resizing by orangeboats on Tuesday October 29, 2024 @01:07PM (#41986709)
Ultimately, X11 opens up everything. What you suggest (WaylandX) is essentially allow-by-default.

When this is the case and there is a supply chain attack, what you think is a trusted application (and therefore not running under "WaylandX") can very well keylog you or take screenshots of your desktop without your consent.

In a deny-by-default model ala Wayland, applications will have to ask for permissions before they can do something considered to be privileged.

Re:Improving Xwayland window resizing by prmoustache on Tuesday October 29, 2024 @06:44AM (#41982330)
> Yes, X11 programs can maliciously keylog each other, but this just isn't a thing that actually happens.

Are you really saying keyloggers do not exist in the wild???

> Wayland can be one part of that sandboxing but is useless without the rest

Yes but that is the point, and if you turn it the other way around X11 usually makes the rest of the sandboxing useless.

Re:Improving Xwayland window resizing by lupusreal on Tuesday October 29, 2024 @07:00AM (#41982507)
I am saying that X11 users getting hit with keyloggers is extremely rare if it happens at all. It's trivial to make such a keyloggers but that doesn't mean it's common for the programs users install to do it.

And yes, X11 makes that sandboxing useless, but that sandboxing isn't in play anyway because we're talking about noobs from Windows.

Re:Improving Xwayland window resizing by prmoustache on Tuesday October 29, 2024 @07:58AM (#41982971)
I think it is dangerous to feel yourself as superior. UNIX veterans can also be victim of supply chain attack, either from their distro package manager, a language module manager, a malicious flatpak with too much access, a trojaned appimage from a supposedly reputable vendor, etc.
Re:Improving Xwayland window resizing by lupusreal on Tuesday October 29, 2024 @09:38AM (#41983724)
Superior? All I'm doing is sticking to programs in my distro's repos. Such programs including malicious keyloggers is unheard of. And if a maintainer turns evil or let's something slip through by accident, the damage they could do is hardly mitigated by Wayland. Thankfully, this virtually never happens

In principle I am also vulnerable to something like a RCE zero day in Firefox turning an otherwise trusty program into malware which exploits X11's open nature, but again, this sort of thing actually happening is unheard of.

I'm not superior, I'm just trying to keep a realistic grip on the threats I face. Modern security culture is fixated on what is theoretically possible, I care more about what is actually likely.

Re:Improving Xwayland window resizing by talldayo on Tuesday October 29, 2024 @11:38AM (#41985132)
> the damage they could do is hardly mitigated by Wayland.

I disagree. How do you hijack interprocess communication on a Wayland device? I can tell you in very certain steps how to manipulate an x11 client but outside hijacking /dev/ I can't imagine a similar attack on Wayland.

Re:Improving Xwayland window resizing by lupusreal on Tuesday October 29, 2024 @12:25PM (#41986002)
If you aren't sandboxes you can edit the user's environment to swap out their programs with backdoored copies.
Re:Improving Xwayland window resizing by immibis on Tuesday October 29, 2024 @08:19AM (#41983116)
There's no rule that an X11 server has to send all keypresses to all processes.
Re:Improving Xwayland window resizing by talldayo on Tuesday October 29, 2024 @11:32AM (#41984979)
But the core framework of every x11 server relies on a loop that does poll HID connected to your machine for events. You can have an x11 server running with no windows connected and your keypresses will still be broadcast to any program that knows where to look.
Re:Improving Xwayland window resizing by immibis on Wednesday October 30, 2024 @05:11AM (#41993113)
That's exactly the same as Wayland, isn't it? Every Wayland compositor also polls HIDs connected to your machine for events. And if your Wayland compositor has permission to open those HIDs when running as your user account, so does any other program you run, regardless of Wayland or X.
Re:Improving Xwayland window resizing by bpye on Monday October 28, 2024 @09:05PM (#41978318)
In my experience Wayland has been a better experience than X11, I have two monitors with different refresh rates and I could never eliminate tearing with X11 whilst Wayland works as expected.
Re:Improving Xwayland window resizing by immibis on Tuesday October 29, 2024 @08:17AM (#41983098)
Wayland does some things well; X11 does some things well. Unfortunately Wayland is not a straightforward improvement. At some point they climbed the abstraction ivory tower and lost sight of the system they were supposed to implement.
Re:Improving Xwayland window resizing by account42 on Tuesday October 29, 2024 @12:14PM (#41985813)
I have not noticed any tearing issues with X11 for a long time, with or without multiple monitors. Were you using X.Org graphics drivers or external vendor blobs?
Re:Improving Xwayland window resizing by bpye on Tuesday October 29, 2024 @01:09PM (#41986742)
I had that issue with both AMD and Nvidia with the open source and proprietary drivers respectively. If I ran both at 60Hz it was fine, but my primary monitor is 144Hz and I couldn’t make 144Hz and 60Hz work well under X11.
Re:Improving Xwayland window resizing by Flimm on Tuesday October 29, 2024 @02:38AM (#41980055)
For me, fractional scaling on a HiDPI screen is broken on X11, but works well in Wayland. Here's an example from yesterday: I was playing Factorio full-screen, and some of the GUI elements were too large and wouldn't fit it in the screen. I found a Factorio setting that enabled Wayland, and it instantly fixed the problem. Kudos to Factorio for supporting Wayland! You wouldn't think it was needed for a full screen game, but it was.
Re:Improving Xwayland window resizing by kaba0 on Tuesday October 29, 2024 @02:54AM (#41980130)
Heh? That hasn’t been true on even the very first POC wayland compositor, Weston. I mean, it used to crash from time to time in the very early days, but visual artifacts? I don’t remember any, besides the occasional xwayland app (which is literally an X app running inside wayland).
Re:Improving Xwayland window resizing by timdiggerm on Tuesday October 29, 2024 @10:18AM (#41984078)
> With X11, on the rare case I noticed, it was usually just a matter of "okay, which toolkit or driver do I need to look up the vsync environment variable for?"

This is not something you should ever have to do

Re:Improving Xwayland window resizing by chaxor on Tuesday October 29, 2024 @01:14PM (#41986834)
This does not make sense at all as an argument really.

I think your argument is about specific implementations of WM. While the argument of "I deal with X11-based WMs because it's fine when I don't care about security at all" may be valid in very narrow cases (such as air-gapped systems), the argument more generally is pretty weak.

Its not surpising that x11 based WMs, such as the almighty [awesomeWM](https://github.com/awesomeWM/awesome), have more features implemented than, for instance, [jay](https://github.com/mahkoh/jay) due to the enormous time it has had to develop (though I am _very_ excited to see `jay` develop more fully, and expect it to be well used by the more tech-savy devs).

However, some WMs in the Wayland space are doing quite well on that front. I recently had some substantial problems arise in my system which (surprisingly to me, but perhaps some are getting used to this) would have been prevented by using a memory safety language for my WM, so I have made the switch to (for better or worse) only ever consider Wayland+Rust WMs. In this space, [niri](https://github.com/YaLTeR/niri) is actually quite good, and to the point - it is developing correctly _and very quickly_. So, any issues on some WM not implementing some desired feature are quickly disappearing.

IIRC, all the major 'gateway' linux distros, such as Ubuntu or Fedora, are all on Wayland by default now - so I don't imagine x11 will stay relevant much longer.

Re:Improving Xwayland window resizing by funcDropShadow on Tuesday October 29, 2024 @11:02AM (#41984542)
... while introducing lot's of other jank that was solved before.
Re:Improving Xwayland window resizing by account42 on Tuesday October 29, 2024 @12:06PM (#41985680)
And once all the Wayland jank is fixed it's going to be just as "crusty" and "full of hacks" and "unmaintainable" as X is now and the cycle is going to repeat again :|
Re:Improving Xwayland window resizing by nph278 on Tuesday October 29, 2024 @12:31PM (#41986099)
The real jank was the friends we met along the way.