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

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Mon, 24 May 2004 10:03:24 +0000

On 23 May 2004 22:58:13 -0400, Nicholas Paul Johnson wrote:
>
> 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'
> #----------------------------------/

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
> disappeared.

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.
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Mon May 24 2004 - 05:06:02 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:56 BST