News for hackers. Stuff that matters.
Re:Improving Xwayland window resizing by ryandrake on Monday October 28, 2024 @06:19PM (#41977073)
Nice results. It's kind of wild that the "before" behavior would be considered acceptable/shippable by anyone. That kind of jank should be a show stopper.
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.
Re:Improving Xwayland window resizing by bsder on Monday October 28, 2024 @06:39PM (#41977280)
"Jank" is still functional. And, to a first order approximation, nobody cares.

Even Windows generally switches down to software rendering when resizing. And on mobile devices, nobody resizes.

No pointer warp, however, is a failure (CAD packages all have significant issues on Wayland). Lack of multilingual support/accessibility is a failure. Lack of screenshots/screencasts is a failure. Lack of support for the BSD lineages is a failure. etc.

People are still bitching up a storm because Wayland still (Pipewire does screen sharing using DBUS(!) for example) hasn't fixed basic things while DeadRat is shoving it down everybody's throat by dropping X11 support.

The Wayland devs aren't wrong about the security implications of this kind of stuff. However, they're also not giving anybody solutions, either.

One big issue is that Wayland devlopment is so slow that the entire space moved forward and destroyed a bunch of assumptions that Wayland is based around.

Re:Improving Xwayland window resizing by DonHopkins on Monday October 28, 2024 @08:13PM (#41978014)
If you mean to use "DeadRat" as a derogatory term for "RedHat", I appreciate the sentiment, but their particular color of headgear has been unfortunately taken over to mean something far more insidious than a dead rat, so you might as well just go back to derogatorily calling them "RedHat" for all of its MAGAstic implications.
Re:Improving Xwayland window resizing by tomxor on Monday October 28, 2024 @07:39PM (#41977773)
> Lack of support for the BSD lineages is a failure.

Not true. FreeBSD and OpenBSD have had various wlroots compositors such as Sway available for some time. e.g [1] Some people have even been experimenting with KDE-wayland on FreeBSD since 2021.

Wayland support on any OS is not binary because there is no single layer like Xorg. It's a matter of individual compositors and their components being ported to the OS, which is a matter of popularity, and the BSDs are always at a disadvantage in that respect, so they lag behind, same as other software. Nevertheless, they are definitely gaining support.

[1] https://docs.freebsd.org/en/books/handbook/wayland/

> Lack of screenshots/screencasts is a failure.

... but there are many functional screencapture apps, and even browser support, I use this pretty much every week. I think you might be operating on out of date info. I'd highly recommend giving it another try, the Wayland ecosystem has come quite far over the last decade.

Re:Improving Xwayland window resizing by p_l on Monday October 28, 2024 @09:18PM (#41978400)
Wayland unfortunately is a mess that is hard to implement so we get a balkanized situation where not only everything often boils down to Big Important Process in the middle (that actually integrates more things than X.Org used to), the set of features it supports are way more balkanized and most importantly, specific to that one Big Important Process as they can't be viably separated out.

And even then you have to deal with a mix because you have to work through two different unsynced possibly broken in weird ways connections (Wayland + D-Bus).

This results in how last week I couldn't screenshare under Wayland, and had zero chances to figure it out - and to make it worse since I had some important state and no time to play with reboots, I couldn't fix it.

Re:Improving Xwayland window resizing by kaba0 on Tuesday October 29, 2024 @03:08AM (#41980208)
XOrg was predominantly used as a useless middleman between a compositor and a window manager communicating with each other. Just because the wayland compositor is “one big important process” doesn’t mean that the whole architecture is more complicated.

Multiple IPCs make the whole stuff way more complex, there is a reason why we have a big monolith as browsers and not some `curl | htmlRender | jsInterpreter` Rube Goldberg machine — the unix philosophy is not the pan ultimate design, it works in some cases and is utterly broken in others.

Re:Improving Xwayland window resizing by p_l on Tuesday October 29, 2024 @04:10AM (#41980762)
X11 != the lowest common denominator implementation of X11. Nor was everyone using it with big heavy compositors (honestly, the only reason I used a compositor for years was intel removing sync circuitry from their iGPUs).

And Wayland did not stop requiring multiple IPCs, in fact it mandates them as several features require passing data by secondary channels, not just for Portals et al - some don't even have any described way to reliably pass the information that I have seen (like how to pass around cookie to let one application activate window of another? Or maybe the spec is such a mess that I'm looking at completely wrong place when I tried to fix ability to reliably switch between applications without extending compositor).

And yes, the architecture is more complicated in practice, otherwise it might have reached parity with what X11 did after as many years - like input method support. Unfortunately it's so broken that you have multiple versions of it in practice, it requires extra IPC in practice, and at least in my experience just does not work.

Re:Improving Xwayland window resizing by badgersnake on Tuesday October 29, 2024 @04:42AM (#41980977)
If you know how to make screen sharing work under Sway on FreeBSD, please do share. I have not managed to figure it out.
Re:Improving Xwayland window resizing by tomxor on Tuesday October 29, 2024 @07:48PM (#41990641)
I'm using Debian so I can't say how well this applies to FreeBSD:

You need to have `xdg-desktop-portal-wlr` or equivalent package installed (should be depended upon by sway package really), and also the gtk one for some other stuff wlroots doesn't implement like notifications I think (don't worry it doesn't drag in all of gnome).

This is technically the only thing you should need to do beyond picking a wayland compatible screen capture program or browser - However it's possible the dbus variables are broken if you wrote your own sway config from scratch (guilty)... Depending on your OS, the default config should do this automatically, on Debian it includes /etc/sway/config.d/50-systemd-user.conf, I can't say for FreeBSD. So point is if your config omits the dbus-update-activation-environment command, you probably need to include it in your config.

TL;DR

    apt install xdg-desktop-portal-{wlr,gtk}
And include this at the top of your sway.conf

    exec dbus-update-activation-environment --systemd \
      DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway
Those environment variables are set by sway, but this line imports them into dbus (is my limited understanding) so that programs call the correct xdg portal backend.

Remember to restart sway to test this.

Re:Improving Xwayland window resizing by tomxor on Tuesday October 29, 2024 @10:23PM (#41991371)
Whoops, you will probably need to remove the --systemd flag.
Re:Improving Xwayland window resizing by cullumsmith on Tuesday October 29, 2024 @09:23AM (#41983608)
The FreeBSD handbook claims that KDE works with Wayland but I have never gotten it to work. X11 still works flawlessly.
Re:Improving Xwayland window resizing by account42 on Tuesday October 29, 2024 @12:36PM (#41986191)
> The Wayland devs aren't wrong about the security implications of this kind of stuff.

But they are wrong. Their security model assumes an ecosystem of untrusted apps when we already had something far superior: distributions with vetted packages.

Wayland is like bolting down your furniture because if you let in random strangers from the street they might steal your stuff. Instead of adding obstacles that make my own life harder I prefer to keep better company.

Re:Improving Xwayland window resizing by TheCoelacanth on Tuesday October 29, 2024 @01:49PM (#41987379)
Vetted packages are great, but they aren't the end of all security problems. Good security needs defense-in-depth.

It's rare but not unheard of for someone to be able to sneak malicious code into a vetted package. It's extremely common for vetted packages to have security vulnerabilities that could be exploited.

I don't want someone who finds a vulnerability in a fart app to be able to escalate that to attack other apps on my computer.

I trust my accountant with a lot of sensitive data but I don't give them the keys to my house. I trust a friend with my house keys to water plants while I'm gone, but I don't give them the password to my bank account.

Re:Improving Xwayland window resizing by account42 on Wednesday October 30, 2024 @03:07AM (#41992474)
What good security needs more than anything is proportionality. After all the only criterium you care about is how secure your computer is then you should simply turn it off because nothing else is going to beat that.

> It's rare but not unheard of for someone to be able to sneak malicious code into a vetted package. It's extremely common for vetted packages to have security vulnerabilities that could be exploited.

Ok, when is the last time you or anyone you know personally sustained any nontrivial damage because of such an event? You can make up hypotheticals to scare people all you want but the simple fact is that no, people are not actually in any more danger on their computer than they are just being alive.

Re:Improving Xwayland window resizing by bee_rider on Monday October 28, 2024 @09:54PM (#41978596)
My window manager had the “before” behavior, but I complained it was defective and they gave it to me free. Not sure how much it would have cost beforehand, but I can’t complain after a 100% discount, right?
Re:Improving Xwayland window resizing by sho_hn on Monday October 28, 2024 @10:31PM (#41978790)
I assume you know this, but just to be sure: The "before" state only happened in a fallback codepath when using a legacy application, i.e. an X11 app in the modern Wayland-based desktop. When using modern apps, or when using the entire desktop in legacy X11 mode, this doesn't happen.

Most legacy X11 apps in active use are actually games which tend to be fullscreen and not resized, so it wouldn't happen that often for many users.

(That said, sure, I can also respect the stance as I tend to place a premium on glitch-freeness too.)

Re:Improving Xwayland window resizing by kevin_thibedeau on Monday October 28, 2024 @11:08PM (#41978982)
This didn't happen on Hummingbird Exceed or Xorg on Windows. It's not X's fault that rendering is wrong in the encapsulating windowing system.
Re:Improving Xwayland window resizing by sho_hn on Monday October 28, 2024 @11:19PM (#41979054)
Nor did I claim it is.

My comment was concerned with making it abundantly clear that this glitch happened in specific scenarios and not just any and all window resizing.