5 ms·
>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
by 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.