PDA

View Full Version : X11 close window by WId



webstar2568
16th February 2012, 06:39
Hi there,

I need to close a window on X11 (window of another application) where I just got a WId (window id). I already searched with Google for terms like "x11 close window by wid" and so on but there was no result that helped me.

Do you have any idea how to do this? I thought that this must be easy but it isn't... at least for me :)

Thanks in advance,
webstar

roxton
16th February 2012, 10:03
Please note, that the killing of windows is NOT the killing of the process. THe window is not a process. You can kill windows by call XDestroyWindow. Or perhaps XKillClient. But, you'll need also to kill the process, using his pid and sending SIGKILL.

webstar2568
16th February 2012, 15:44
Hey there,

thanks for the reply. I don't want to kill the whole application but I want to close a single window. Does "destroying" a window is the normal way of closing it like e.g. when pressing the close-window-button in the window manager?

hermannk
22nd May 2014, 09:57
I need to close a window on X11 (window of another application) where I just got a WId (window id). I already searched with Google for terms like "x11 close window by wid" and so on but there was no result that helped me.


I just tripped over a related problem. Acroread opened a window with a thumbnail of the document I was reading. It always was on top of the display (in all workspaces!) and I wanted to get rid of it w/o killing acroread. I had opened many documents in acroread. First, I got the Wid by starting xwininfo and clicking on the gadfly. Then I used xdotool windowkill 0x482bc1a to close the window.

Alas, this killed acroread. The behaviour is quite unpredictable. While roxtron was afraid of not killing the application and leaving a zombie, I accidently killed the application.

Hermann