I’ve got a fvwmiconman that I would like to behave like this: when I click the left mouse button on an icon, I want the window to (1) raise if it’s not raised and not iconified, (2) iconify if it’s raised (3) deiconify if iconified. I know it must be pretty simple, but I just can’t get it… here’s what I have so far…
*FvwmIconMan: Action Mouse 1 N sendcommand FuncFvwmIconClick
and
DestroyFunc FuncFvwmDeiconifyRaiseFocus
AddToFunc FuncFvwmDeiconifyRaiseFocus
+ I Iconify false
+ I FlipFocus
+ I Raise
DestroyFunc FuncFvwmFocusRaise
AddToFunc FuncFvwmFocusRaise
+ I FlipFocus
+ I Raise
DestroyFunc FuncFvwmIconClick
AddToFunc FuncFvwmIconClick
+ I ThisWindow (Raised) Iconify true
+ I ThisWindow (Iconic) FuncFvwmDeiconifyRaiseFocus
+ I ThisWindow (!Raised) FuncFvwmFocusRaise
Depending what order I put the lines in that last function, the window either iconifies then deiconifies, or the other way around… How can I make it do the right one, then stop?
What’s happening is that you only want the action to happen once, depending on the state of the window. Now by-and-large that ought to be fine. The only reason I can think of that would lead to the problems you’re having, is if you’re using FvwmEvent, that’s listening for a specific action…
As to what:
+ I TestRc (Match) Break
… does, well… TestRc looks at the return code from the previous command run, and then if it was successul, then it will run whatever you tell it. In this case, we want to exit the function, so “Break”.