[comp.windows.x] jordie needs help again

jkh@VIOLET.BERKELEY.EDU (Jordan K. Hubbard) (12/06/87)

Ok.. Maybe this is a bug, maybe it ain't. I have the following situation:

uwm is selecting SubstructureRedirect on the root window, which works fine
for finding out when windows need to get mapped and such.. However, once
I start reparenting windows to windows that uwm creates (title bar frames),
I lose the ability to find out when they are destroyed. I stop getting
destroy events on the root window (which makes sense), but selecting
StructureNotify on the client window doesn't seem to work either. I've
also tried doing a SubstructureRedirect on the title bar frame, but that
*really* bitches things up. I have not yet figured out why.

To sum up what I want to do:

I want to detect whenever a window is mapped/destroyed/configured at the root
level (for non-title bar mode and icons).

I want to reparent a window at will and still get this information,
but now relative to the title bar "frame" window.

What should I select and on whom?

Any clues? What am I doing wrong? uwm with title bars and all the other
nifty features *almost works* but for this irritiating problem.

					Jordan Hubbard
					jkh@violet.berkeley.edu

hania@DECWRL.DEC.COM (12/06/87)

> To sum up what I want to do:
>
> I want to detect whenever a window is mapped/destroyed/configured at the root
> level (for non-title bar mode and icons).
>
> I want to reparent a window at will and still get this information,	
> but now relative to the title bar "frame" window.
>
> What should I select and on whom?

To get notified of the destruction of reparented windows you should
select for SubstructureNotify on the window that the client window has
been reparented to.  After being reparented, the client window becomes
a subwindow of the uwm-created window, hence the "Sub"structure.

To get notified of the destruction of non-reparented client windows
(children of the root), you should select for SubstructureNotify on the root.

Hope this is clear.  Look at wm for an example of code that does the  first part.

   Hania

jkh@VIOLET.BERKELEY.EDU (Jordan K. Hubbard) (12/07/87)

Bob, is right (though he's his usual caustic self) about the level
of detail I provided. The problem turned out to be a misunderstanding on
my part.. Something that *WASN'T TOO DIFFICULT* considering that the
documentation on things like SubstructureRedirect and SubstructureNotify
is somewhat vague. Could someone please post a concise and accurate
description of what they do? What if the client selects SubstructureRedirect
on the root window as well as several subwindows? How exactly is "redirection"
defined? If I have 3 subwindows under the root, and I select Substructure-
Redirect on one, and on root for the rest, what happens?

By the way, Bob, let it not be felt that your efforts are unappreciated.
I know that everyone and their brother is bugging the hell out of you
and that your bloodstream is probably 90% caffine by now... 
I'll try to be a little more precise in the future to spare your
blood pressure.

						Jordan

RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) (12/07/87)

    Date: Sun, 6 Dec 87 17:17:33 PST
    From: jkh@violet.Berkeley.EDU (Jordan K. Hubbard)

	      Something that *WASN'T TOO DIFFICULT* considering that the
    documentation on things like SubstructureRedirect and SubstructureNotify
    is somewhat vague.

Agreed, but the state of affairs probably won't improve unless people a)
tell us how and what they got confused about or b) provide us with
alternate descriptions.

			Could someone please post a concise and accurate
    description of what they do?

Well, of course, I think what's in the protocol spec is concise and
accurate, but then I'm biased.  See the 2nd and 3rd (or 3rd and 4th,
depending on how you count) paragraphs of ConfigureWindow, the 1st
paragraph of MapWindow, and/or do a case-insensitive search for
"reparent".

				 What if the client selects SubstructureRedirect
    on the root window as well as several subwindows?

What if what?  SubstructureRedirect selections on independent windows
are independent.

						      How exactly is "redirection"
    defined?

Redirection is the act of turning a request or action into an event to
some other client.

	      If I have 3 subwindows under the root, and I select Substructure-
    Redirect on one, and on root for the rest, what happens?

What happens when?  SubstructureRedirect only applies to direct
children, not arbitrary inferiors.  The selections are independent.