I’m stumped with this one.
I have a FvwmButtons panel at the bottom of my screen with a swallowed FvwmIconMan. When you click on a window’s button it’s supposed to deiconify, focus, raise, and unshade the window unless it already is all of those things, in which case it’s supposed to iconify. These functions worked fine for me in FVWM version 2.5.10 but with my recent upgrade to 2.5.12 it only works correctly when there’s more than one open window that’s not iconified. When it doesn’t work it appears to iconify the window and immediately deiconify it.
This is the function bound to mouse 1 in FvwmIconMan
- I ThisWindow (!Iconic, Iconifiable, !Shaded, Focused) FvwmIconify true
- I TestRc (Match) Break
- I FvwmIconify false
- I WindowShade false
- I Focus
- I Raise[/code]
FvwmIconify is just a wrapper around Iconify that’s supposed to focus the previous window when a window is iconified. Using a plain “Iconfiy” instead of the first call to FvwmIconify in FvwmToggleIconification works (but without the FocusPrev thing I require). The second call to FvwmIconify is interchangeable with a plain Iconify.
- I ThisWindow (!Iconifiable) Break
- I Iconify $0
- I FvwmFocusPrev[/code]
FvwmFocusPrev is just this one line
- I Prev (AcceptsFocus, CurrentDesk, CurrentPage, !Iconic) Focus[/code]
Since just using Iconify works, FvwmIconify will also work if I comment out the first and third lines. By commenting out just the first line it still fails to work (as the first line should be irrelevant). And by commenting out just the third line it fails to work regardless of how many windows are open. Why it doesn’t work in this instance is beyond me. If I leave all three lines in and remove the “!Iconic” in FvwmFocusPrev it works for some reason but gives the focus to an iconified window, leading me to believe the problem is here and Prev is choosing a window when none should qualify. However, FvwmFocusPrev works fine with a window button that simply calls FvwmIconify (with no problems in that function either) so it has to be the first call to FvwmIconify in FvwmToggleIconification. Probably. I have no idea; any insight may prevent my head from imploding.