Hi Mikhael,
I finally used the following function, that fits my need :
AddToFunc SwitchIconification
+ I DestroyFunc FuncIconifyRaised
+ I AddToFunc FuncIconifyRaised
+ I WindowId $w (Raised !Iconic) + I Iconify true
+ I WindowId $w (!Raised) MyActivateWindow
+ I WindowId $w (Iconic) MyActivateWindow
+ I FuncIconifyRaised
(I Had to add the Iconic condition since the windows seem to keep on
satisfying the Raised condition, after they are iconified)
Thanks again,
Denis
Le Dimanche 17 Février 2002 20:49, vous avez écrit :
> On 17 Feb 2002 08:20:19 +0100, Denis Prost wrote:
> > Le Dimanche 17 Février 2002 02:51, vous avez écrit :
> > > On 16 Feb 2002 11:29:45 +0100, Denis Prost wrote:
> > > > Could anyone help me to achieve the following common taskbar
> > > > behaviour, either with FvwmTaskBar or FvwmIconMan :
> > > >
> > > > - when you click on the focused window button, the window is
> > > > iconified - when you click on any other button, the window is
> > > > deiconified if it was iconified, raised and focused.
> > >
> > > Sorry, the behaviour you want is not common, it requires if-else
> > > syntax. You may just bind these opposite actions to different mouse
> > > buttons. Ok, one way to emulate if-else syntax is dynamically created
> > > functions:
> > >
> > > *FvwmTaskBar: Action Click1 SwitchIconification
> > >
> > > AddToFunc SwitchIconification
> > > + I DestroyFunc FuncIconifyFocused
> > > + I AddToFunc FuncIconifyFocused
> > > + I WindowId $w (Focused) + I Iconify true
> > > + I WindowId $w (!Focused, Iconic) MyActivateWindow
> > > + I FuncIconifyFocused
> > >
> > > AddToFunc MyActivateWindow
> > > + I Iconify false
> > > + I Raise
> > > + I Focus
> > >
> > > There probably will be if-else syntax in the future, but this works
> > > well.
> >
> > Thanks a lot for your help. It works fine for windows that are not
> > focused, but I can't get the focused window iconified. I replaced "+ I
> > Iconify true" by "+ I Echo Focused" to see what happens, and it seems
> > that the condition (Focused) never gets satisfied, whatever button I
> > press.
> >
> > Do you have any idea about what happens ?
>
> I forgot to say that the "Focused" condition is introduced in 2.5.0.
>
> You may try to replace it with "Raised" and see whether it's ok for you.
>
> In 2.4.x it is possible to catch the name of the focused window using
> SetEnv and then match against it, but I don't really suggest this, since
> this only works well if all window names are unique.
>
> If you want the exact behaviour, I suggest you to upgrade to the latest
> daily snapshot (pre-2.5.1).
>
> 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 Sun Feb 17 2002 - 23:50:58 GMT