Subject: FVWM: KDE-like taskbar or iconmanager behaviour

From: Denis Prost <[email-masked]>
Date: Sat, 16 Feb 2002 11:29:45 +0100

Hi all,

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.

thanks

Denis

--
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: Sun, 17 Feb 2002 01:51:49 +0000

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

Regards,
Mikhael.

---

From: Denis Prost <[email-masked]>
Date: Sun, 17 Feb 2002 08:20:19 +0100

Hi Mikhael,

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 ?

Regards

Denis

---

From: Mikhael Goikhman <[email-masked]>
Date: Sun, 17 Feb 2002 19:49:55 +0000

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

---

From: Denis Prost <[email-masked]>
Date: Mon, 18 Feb 2002 05:43:42 +0100

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