News for hackers. Stuff that matters.
Re:What process created this X11 window? by AnotherGoodName on Friday November 10, 2023 @11:55AM (#38221205)
>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?

Re:What process created this X11 window? by kimixa on Friday November 10, 2023 @12:23PM (#38221615)
That'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.
Re:What process created this X11 window? by hawski on Friday November 10, 2023 @04:06PM (#38224540)
https://gitlab.freedesktop.org/xorg/app/xkill/-/blob/master/...

It literally is using 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.

Re:What process created this X11 window? by josefx on Friday November 10, 2023 @01:21PM (#38222471)
Quite 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.
Re:What process created this X11 window? by russellbeattie on Friday November 10, 2023 @03:19PM (#38223985)
Funnily 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.