7 ms·
What process created this X11 window?
- H8crilA 3y agoDidn't use a magnetic needle and a steady hand, I am disappointed.
- yrds96 3y agoNeither butterflies
- deleted 3y ago[deleted]
- calvinmorrison 3y agoWhy 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
- notpushkin 3y agoNot 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).
- password4321 3y agoI left Ubuntu because of snap, still haven't heard anything positive so seems like the right move so far.
- notpushkin 3y agoUnironically: yeah, I've switched to Debian everywhere and never looked back.
- tuyiown 3y agoWell 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.
- deleted 3y ago[deleted]
- dig1 3y agoIn 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.
- pests 3y agoAnd we thought chrome was genius to introduce one process per tab. One container per tab, its better than one VM per tab.
- bigbillheck 3y ago> Why is x11 so backwards? Hasn't it been pretty much ossified for the last 30 years?
- spellcard199 3y agoUnder 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/compositor https://gitlab.gnome.org/GNOME/mutter/-/tree/fc1de744/src/co...
- yjftsjthsd-h 3y ago...wait, does Wayland not have a drop in replacement for xkill?
- calvinmorrison 3y agoSimply 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.
- deleted 3y ago[deleted]
- dontlaugh 3y agoWayland 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.
- yjftsjthsd-h 3y agoI 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?
- cbm-vic-20 3y ago> 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.
- calvinmorrison 3y agoI 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
- wnoise 3y agoThe more on-point sarcasm is, the harder it is to distinguish from the actual proponents' views.
- pjmlp 3y agoWhile 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.
- erik_seaberg 3y agoI’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.
- Izkata 3y ago> 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.
- lupusreal 3y agoHigh grade sarcasm? You had me going until the power button part.
- dontlaugh 3y agoI suspect this is satire.
- calvinmorrison 3y agoThe 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
- dontlaugh 3y agoI 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.
- deleted 3y ago[deleted]
- l72 3y agoThings can get really complicated with x11 when you have processes running on remote machines or using XEmbed. With XEmbed, what may look like a single window is actually multiple windows all managed by different processes with their own render loops. Speaking of XEmbed, many years ago, we had an application that ran complicated visualization pipelines. We wanted to add a modern GUI around it to configure it and provide interaction. We didn't have the ability to rewrite the original application, so we wrote a Gtk GUI and used XEmbed to embed the other process in it, then used a unix socket to send commands back and forth. To the user, it was seamless and worked really well!
- thriftwy 3y agoX11 is a network protocol. The process which created this X11 windows could be on a different box, running in the kernel or have the whole X11 exchange replayed from the magnetic tape.
- nwatson 3y agoThe posed question addresses this in the second paragraph, after the very short first paragraph.
- jameshart 3y agoPresumably which of these states of affairs pertains to a specific window is, though, at some level knowable. The question of which process created the window is not necessarily bounded to ‘processes running in user space on this machine right now’, but something created it. And 99% of the time the answer will be a locally running process, which makes it a highly pertinent question even without the caveats. It’s not clever to point out that a question may not have a simple answer and therefore to reject the question as flawed.
- arethuza 3y ago"And 99% of the time the answer will be a locally running process" Depends on the environment - for years I used either an HP X terminal or a PC running an X server and the one thing I could be confident about in both cases was that the process wasn't running locally. Mind you - that wasn't recently!
- cduzz 3y agoFrom a 2020's perspective, X11 is deeply weird. It was written back when huge enormous servers were the only systems with enough oomph to do anything useful, and those servers had 128mb of ram (think of something like a sun 3/480 with a 33mhz 68030). It was common to have a room of X terminals each with 1-8mb of ram for a 15-19 inch display (with 1-8bit color). In that context, everything ran on another system, often you'd have processes running on several different systems and you'd have to be careful about managing authorization otherwise people would figure out your DISPLAY and run their programs against your X terminal (innocuous, like 300 Xeyes programs or malicious like a keyboard snooper, depending on where and when). In 2020 this whole scenario sounds absurd, but it was the way of things from when X11 was designed and through the first 15 years of X being a thing. In some ways, the question is like asking "what is the process ID that generated this http response?" [edited to add the analogy]
- electric_dreams 3y ago[dead]
- AnotherGoodName 3y ago>The easiest way to check who that window belongs to is to run XKillClient for it i.e.: xkill -id 0x1600045 and see which process just died. But only if you don't mind killing it of course! But but but what does xkill use internally to figure this out. Can we just use that?
- kimixa 3y agoThat's not mapping a PID to the window though - it's just destroying a window ID and seeing what happens to error out - which might not happen if the app was written to handle the window being destroyed outside it's control, or it's running on a different machine where you won't see any error output/a process dying.
- hawski 3y agohttps://gitlab.freedesktop.org/xorg/app/xkill/-/blob/master/xkill.c?ref_type=heads#L234 https://gitlab.freedesktop.org/xorg/app/xkill/-/blob/master/... It literally is using XKillClient - https://linux.die.net/man/3/xkillclient https://linux.die.net/man/3/xkillclient You can kill the connection of another client if you know its id. That's one of the reasons why we love X11 so much. Another way, as josefx mentioned, is to kill the PID from _NET_WM_PID window property. This is often used by window managers when they offer to kill an unresponsive application.
- josefx 3y agoQuite sure it just uses _NET_WM_PID and fails if it isn't there. At least as far as I remember I had issues terminating my own application with xkill until I set the _NET_WM_PID myself, the framework I used only did the bare minimum to get a window on the screen.
- russellbeattie 3y agoFunnily enough, this is how I usually figure out who's using a long running, but unknown server process. Kill it and quietly listen to see if anyone in the office immediately screams. If so, quickly restart it and log out. Otherwise move on with your day, and wait for any angry emails.
- superdisk 3y agoSo wild, I googled this exact thing yesterday and got to the same stackoverflow post. And now it's on the first page of HN.
- mmh0000 3y agoThis has happened to me a few times with HN. I suspect HN is really run by a hyper-intelligent A.I. which is guiding us all to a brighter future.
- kazinator 3y agoYou're discounting billions of people to whom this didn't happen, because of which they didn't make a HN comment about it.
- glouwbug 3y agoI think he was just making a joke
- LoganDark 3y agohttps://xkcd.com/1827 https://xkcd.com/1827
- Avshalom 3y agohttps://xkcd.com/196/ https://xkcd.com/196/ feels more appropriate in this thread.
- edgyquant 3y agoNo he’s not. He’s speaking entirely about the one person who did do this thing
- kazinator 3y agoThat's another way of expressing exactly the same cognitive bias.
- crotchfire 3y ago[flagged]
- svat 3y agoThe question mentions this in the very second line? “Of course this isn't always possible, for example if the window came over a TCP connection.” The link is to the question and answer, not to just the title. (And there's already another thread right here in this HN discussion about the same thing, posted ~15 hours before your comment: https://news.ycombinator.com/item?id=38218800 https://news.ycombinator.com/item?id=38218800)