News for hackers. Stuff that matters.
Re:What process created this X11 window? by calvinmorrison on Friday November 10, 2023 @07:53AM (#38218239)
Why is x11 so backwards?

On Wayland, each window is a composer, each component that makes up a screen is a compositor. Don't mid them up. Simply put each window manages their own process tree as its much cleaner. Its very simple. What you need to do is simply install dbus-systemd and issue SummonPoettering which will give you a clean docker workspace. Simply put this is far superior to X11. In short on Wayland, you only need to push one button to kill an errant window - the power button

Re:What process created this X11 window? by spellcard199 on Friday November 10, 2023 @08:32AM (#38218570)
Under Wayland with Gnome (it's gnome-specific), I recently learned you can kill windows by using Looking Glass:

  // 1. Open looking glass: Alt+F2 > lg
  // 2. Use picker to pick window (button on the top left corner).
  // 3. Now an object r(0) of type MetaSurfaceActor is available in the
  //    gjs console (or some other number if you've already used it).

  // To get pid:

  r(0).get_parent().get_parent().get_meta_window().get_pid()

  // To kill window and process:
  
  r(0).get_parent().get_parent().get_meta_window().kill()
Reference for what those .get_parent() refer to: https://gitlab.gnome.org/GNOME/mutter/-/tree/fc1de744/src/co...
Re:What process created this X11 window? by yjftsjthsd-h on Friday November 10, 2023 @09:35AM (#38219352)
...wait, does Wayland not have a drop in replacement for xkill?
Re:What process created this X11 window? by calvinmorrison on Friday November 10, 2023 @09:58AM (#38219628)
Simply jump into a Javascript runtime and run some functions from your runner! BTW your entire desktop is just an electron app rendering Wayland in WebGL.
Re:What process created this X11 window? by dontlaugh on Friday November 10, 2023 @10:16AM (#38219864)
Wayland doesn't have the kind of abstraction that would allow that, partly since it would make it very hard to guarantee perfect frame rendering.

A lot of what X11 does is instead handled by Wayland "compositors", they deal with almost all such policy logic. This is largely the same situation as on Windows or macOS, which Linux desktops are finally starting to catch up to.

Re:What process created this X11 window? by yjftsjthsd-h on Friday November 10, 2023 @10:39AM (#38220184)
I can't tell what level of parody we're at; if we're currently being serious, why would xkill or equivalent make rendering any harder than a normal close event?
Re:What process created this X11 window? by dontlaugh on Friday November 10, 2023 @10:46AM (#38220276)
It would require that Wayland be aware of internals of the "compositor". Instead of that, Wayland is only aware of surfaces, which it can guarantee can be stitched together within a certain time budget. Hence none of the tearing that is unavoidable with X11.

A window close event goes to the "compositor" of a surface, without being aware of which PID may have caused what is currently rendered on that surface.

Windows and macOS do the same, if only because they have a single "compositor"/window manager.

Re:What process created this X11 window? by calvinmorrison on Friday November 10, 2023 @12:28PM (#38221703)
I don't think it's parody. Wayland is just so kafkaesque not even windows know their own contents.
Re:What process created this X11 window? by dontlaugh on Tuesday November 14, 2023 @06:20AM (#38261882)
Windows know their own contents, but Wayland doesn't. "Compositors" do know which PID has which window, though. Hence why there are "compositor"-specific alternatives to xkill.
Re:What process created this X11 window? by spellcard199 on Friday November 10, 2023 @10:18AM (#38219892)
Some weeks ago I searched for a more general solution that doesn't depend on the compositor and doesn't need root (i.e. an xkill replacement), but I didn't find one.

As a frequent user of xkill I was surprised by that too, but I remember reading somewhere that making a terminal application kill another application's window is not allowed by design. Reusing a sibling commenter's analogy, it's kind of like some javascript functions in the browser can only be triggered by user actions for security reasons.

The compositor, however, is allowed to kill the windows it's showing. So if you want to kill a window, you can ask the compositor to do it for you. Gnome, KDE [0], sway [1], etc.. each expose this functionality in a way that differ between each other.

[0] https://www.reddit.com/r/kde/comments/1242w2e/wkillsh_an_xki...

[1] https://www.reddit.com/r/linuxquestions/comments/ufw7tj/is_t...

Re:What process created this X11 window? by calvinmorrison on Friday November 10, 2023 @10:34AM (#38220118)
And eventually KDE, Gnome, and so forth will develop a shared layer on top of Wayland to handle such core functions can call them Wprops, they'll all implement the same _NET_WAYLAND_HINTS and a new group freewayland.org will come together to standardize it. Then waykill will work globally
Re:What process created this X11 window? by yjftsjthsd-h on Friday November 10, 2023 @10:43AM (#38220234)
But of course by then (late 2030s) we as an industry will appreciate that Wayland has deep unfixable flaws and nobody is willing to maintain it and everyone should switch to ... V-something... let's say "Vineyard", the new graphical system that everyone agrees we should switch to ASAP because this time we got it right;)
Re:What process created this X11 window? by Qwertious on Friday November 10, 2023 @11:36AM (#38220932)
In the 2030s everyone will finally acknowledge the sheer elegance of Arcan ( www.arcan-fe.com ) and admit out loud that Wayland's "just use a GUI toolkit!" was cope for Wayland being a reflexively underspecified protocol, an unfortunate result of its devs suffering from X11-PTSD.
Re:What process created this X11 window? by hulitu on Friday November 10, 2023 @01:01PM (#38222169)
Lol. You must be new to SW development "good practices". If they don't "release" a new library version every second year, "god" will strike them. /s
Re:What process created this X11 window? by bitwize on Friday November 10, 2023 @01:30PM (#38222590)
Vineyard I can actually see, after Martha's Vineyard -- following the Red Hat trend of naming system components after Massachusetts towns (Wayland, Weston, Dracut, Plymouth...).
Re:What process created this X11 window? by notpushkin on Friday November 10, 2023 @08:06AM (#38218333)
Not if running on Ubuntu! They've replaced Docker with Snap, so you will have to dbus into ~/snap and patch the hook into the package. Of course, this will not work with the inferior Flatpak apps (which you shouldn't be using anyway as they are buggy and not as cool as snaps).
Re:What process created this X11 window? by password4321 on Friday November 10, 2023 @08:53AM (#38218793)
I left Ubuntu because of snap, still haven't heard anything positive so seems like the right move so far.
Re:What process created this X11 window? by notpushkin on Friday November 10, 2023 @01:14PM (#38222366)
Unironically: yeah, I've switched to Debian everywhere and never looked back.
Re:What process created this X11 window? by bigbillheck on Friday November 10, 2023 @08:30AM (#38218537)
> Why is x11 so backwards?

Hasn't it been pretty much ossified for the last 30 years?

Re:What process created this X11 window? by tuyiown on Friday November 10, 2023 @08:19AM (#38218435)
Well a definitive press of the power button seems the good way of killing a window, as such notion simply shouldn't exist. One could also argue that those who complains in sarcasm about such unnecessary longings should do the same.
Re:What process created this X11 window? by dig1 on Friday November 10, 2023 @08:29AM (#38218533)
In the future, someone will (re)invent wayland-compose.yaml and announce that as the second-best thing after sliced bread. Imagine that technology - each window is a separate container! Our ancestors would be so proud. Then, you start your browser via "wayland-compose up" and that will load 50 additional containers via dbus-systemd, because "that is the only proper way" to run your application.
Re:What process created this X11 window? by pests on Friday November 10, 2023 @03:00PM (#38223746)
And we thought chrome was genius to introduce one process per tab. One container per tab, its better than one VM per tab.
Re:What process created this X11 window? by cbm-vic-20 on Friday November 10, 2023 @09:12AM (#38219055)
> Why is x11 so backwards?

Because it was built in a different time. Back in the 80s and early 90s, X11 provided a way for institutions and companies to mix-and-match their hardware and software environments, each with different capabilities. They would have big iron running expensive software and cheap(er) terminals that could display those applications across a campus.

In a university environment, before there was a PC and network in every dorm room, before laptops were a thing, this was awesome. You could walk up to any workstation or X11 terminal on campus, and immediately have access to all of your applications, files, and everything else. And when PCs and networking came to the dorms, you could get an X server for your PC and do the same.

But those days are long past; the networking use case, which was one of the most important aspects of X11, is pretty much no longer relevant. It's really surprising that Wayland still hasn't completely taken over, and they still haven't figured out how to handle certain interprocess communication that would allow screen sharing and other common desktop functionality.

Re:What process created this X11 window? by calvinmorrison on Friday November 10, 2023 @09:55AM (#38219586)
I felt my comment was so dripping with sarcasm nobody would miss it. SummonPoettering??? Yet like a moth to a flame you missed the point and jumped right into the reasons x11 sucks
Re:What process created this X11 window? by wnoise on Friday November 10, 2023 @01:48PM (#38222824)
The more on-point sarcasm is, the harder it is to distinguish from the actual proponents' views.
Re:What process created this X11 window? by pjmlp on Friday November 10, 2023 @09:58AM (#38219633)
While true, it wasn't the only protocol for doing that, just the one that won mostly due to OSF/Motif politics, when GNU/Linux came to be that was already pretty much settled.
Re:What process created this X11 window? by erik_seaberg on Friday November 10, 2023 @04:48PM (#38224979)
I’m still predicting that Wayland will become an implementation detail of web browsers and some games. It doesn’t make sense for every app to render pixels in software and stream them from a datacenter, not for every desktop to have its own copy of every app.
Re:What process created this X11 window? by Izkata on Friday November 10, 2023 @09:26AM (#38219245)
> Simply put each window manages their own process tree as its much cleaner. Its very simple.

And not correct: Processes can have multiple windows. Or no windows.

Re:What process created this X11 window? by dontlaugh on Friday November 10, 2023 @09:49AM (#38219514)
I suspect this is satire.
Re:What process created this X11 window? by calvinmorrison on Friday November 10, 2023 @09:57AM (#38219613)
The fact 5 commenters did not understand it shows how willingly people will put up with the limitations of their software and diss the software they don't like.

Surely the summoning of Leinart Poettering's spirit to find dead Pids in Waylands Hades was a dead giveaway

Re:What process created this X11 window? by dontlaugh on Friday November 10, 2023 @09:58AM (#38219631)
I think it was funny, despite how much X11 has annoyed me over the years or how much I appreciate the correctness goals of both systemd and Wayland.