Subject: Re: FVWM: Intricacies of the Next() function / Conditionals

From: Nicholas Paul Johnson <[email-masked]>
Date: Sat, 1 May 2004 10:39:33 -0400 (EDT)

So,

Should I infer from the silence that there is no way to do this, or that 
no one knows?

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

On Fri, 30 Apr 2004, Nicholas Paul Johnson wrote:

> Howdy,
> 
> I am trying to define a function, called Close_fcn, which is bound to the
> close button on my title bars.  I would like this function to, in addition
> to closing the window, automatically focus another window which may or may
> not be on the same desk.  What I have so far is:
> 
> #------------------
> DestroyFunc Close_fcn
> AddToFunc Close_fcn
> + "I" Close
> + "I" Next (!Sticky) Focus
> 
> Mouse 1 7 A             Close_fcn
> #------------------
> 
> However, I would like to impose an ordering on these windows: I would like
> it to (1) focus a window on the same desk if available, and (2) focus any
> other window if [1] fails.
> 
> So, is this possible?  I use fvwm 2.4.16
> 
> Also,
> 
> Is it possibly for me to bind a function to the event that a window is
> closed (not necessarily explicitly)?  The example of this situation that
> comes to mind is xpdf, which has a big 'quit' button.  Can I bind a
> function to be called when this 'quit' button causes the window to close,
> just as if the close button on the titlebar were pushed?
> 
> 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].
>

--
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: Sat, 1 May 2004 16:21:26 +0000

> Should I infer from the silence that there is no way to do this, or that 

Probably the right guess would be that people who know didn't have a time
yet to read the question or to compose a good answer. I for one was not
even online yesterday when you asked. Be patient.

Regards,
Mikhael.

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 1 May 2004 18:05:21 +0000

> not be on the same desk.  What I have so far is:

I just tried 2.5.x and 2.4.x and these behave equivally regarding this
feature. With ClickToFocus policy, Close alone works even better than you
want. I.e. if you close the focused window, the previously focused window
on the same desk gets the focus (not just any random window).

If you use MouseFocus this does quite not work, since you just get the
window under the pointer (or no window) focused. This is what MouseFocus
is all about.

And with SloppyFocus, Close works agian like you want, you either get the
previously focused window or a window under the pointer.

Please describe again what is your desired behaviour and what is your   
focus policy for windows. Try Close alone, it works for me.

Use SloppyFocus instead of MouseFocus if this is what you want.

As for your Next command question, try this command:

  Prev (CurrentDesk, !Sticky) Focus

> just as if the close button on the titlebar were pushed?

Take a look at FvwmEvent module, it does what you want.

Just don't use both methods simultaneously, chose either "smart" close
button, or "smart" close event.

Regards,
Mikhael.