Subject: FVWM: FvwmEvent: destroy_window ; is a window transient?

From: Nicholas Paul Johnson <[email-masked]>
Date: Sun, 23 May 2004 22:58:13 -0400 (EDT)

Hello,

I have a function bound to the destroy_window event, whose purpose is to 
focus another window automatically.  I would like it to only do this if 
the window being closed is not transient.  Here is my original, which 
works except that it does not distinguish between transients and 
non-transients:

#---------------------------------\
DestroyFunc CycleLocally
AddToFunc CycleLocally
+ "I"           Next (CurrentDesk, !Sticky) \
			Function FocusAndRaise
+ "I"           TestRC (0) Next (!Sticky) \
			Function FocusAndRaise

*FvwmEvent: destroy_window \
	'Function CycleLocally'
#------------------------------------/

So, I tried this modification:

#----------------------------------\
*FvwmEvent: destroy_window \
	'Current (!Transient) Function CycleLocally'
#----------------------------------/

But that didn't work; the event seems to be called *after* the window has 
disappeared.

How can I do this?

Thanks,
- -- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Nicholas Paul Johnson
  o nickjohnson \at\ virginia \dot\ edu
  o 3ebf10a7 subkeys.pgp.net
  o http://manjac.ath.cx/nick
  o "When all you've got is a hammer,
    everything looks like a nail.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 24 May 2004 10:03:24 +0000

> works except that it does not distinguish between transients and 

First, if you want to work on a correct window, never use Current with
FvwmEvent (unless you want to always work on the focused window that may
or may not be the window caused the event). Just call the needed command,
it will be executed under the context of the original window, or use
ThisWindow conditional. I.e. one of these:

  *FvwmEvent: add_window Iconify

  *FvwmEvent: add_window 'ThisWindow (!Transient) Iconify'

  *FvwmEvent: destroy_window 'ThisWindow (!Transient) CycleLocally'

> But that didn't work; the event seems to be called *after* the window has 

Just tried, although you can't iconify (or move for example) a window
being destroyed, you may still access all its properties. (But you may
iconify or move a different window on destroy_window event of course.)

Regards,
Mikhael.

---

From: Nicholas Paul Johnson <[email-masked]>
Date: Tue, 25 May 2004 02:15:57 -0400 (EDT)

>   *FvwmEvent: destroy_window 'ThisWindow (!Transient) CycleLocally'
This seems to work.  Thank you :)