On Thursday February 22 2024 17:56:17 Richard Troy wrote:
Hi,
>I got it that to unmap I'd need to write a C program using Xlib and call
>XUnmapSubwindows(Display *display, Window w); Not having written an
>Xlib-using program before - or at least not in maybe 30 years! - and not
>feeling a need to get deep into it, is / are there a presumption(s) of
>which window / display is/are the target if they're directly associated
>with the code that's running the unmap call? Same goes for calling
>XMapWindow?
Sorry, I don't get your question?
I'm having difficulties recalling in which context I have encountered unmap
actions in existing applications. Most likely in a window manager I used or
tested at some point, but which...
Either way, with X you need to open the correct display first (a priori just
using the value of the DISPLAY env. variable). For the window things can get a
bit tricky because the window manager and/or the xwininfo command can
(apparently) hide the fact that the actual window you're interested in has been
reparented by the window manager. You can see that easily by using xwininfo
without arguments (and click on a window of interest to see what data that
returns) and then look up the returned window id in the output of `xwininfo
-root -tree -all`.
On my system, I'm seeing something like if 0x6800026 is my window of interest:
xwininfo: Window id: 0xf6 (the root window) (has no name)
Root window id: 0xf6 (the root window) (has no name)
Parent window id: 0x0 (none)
209 children:
SNIP
0x2200054 (has no name): () 832x768+0+0 +0+0
1 child:
0x2200055 (has no name): () 832x742+0+26 +0+26
1 child:
0x6800026 "XXX — Konsole": ("konsole" "konsole") 832x742+0+0 +0+26
As you can see my konsole window has a grandparent that's just a bit higher:
this is the window that includes the titlebar. The intermediate (parent) is
probably there to allow for kwin's fancy rendering through the compositor but
that's just a guess.
I am also guessing that you are thinking of writing a utility that works more
or less like xkill, except that it does an unmap? If so, I'd get the source for
xkill, make those changes and then see what the effect is. In principle the
window manager should react appropriately to unmap/iconify/etc actions on the
client window because the client could invoke those actions itself.
That's all I can think of to help at this time.
R.