4 ms·
https://gitlab.freedesktop.org/xorg/app/xkill/-/blob/master/xkill.c?ref_type=heads#L234 https://gitlab.freedesktop.org/xorg/app/xkill/-/blob/master/... It lite
by hawski 3y ago
https://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.