This is my “Show Desktop” function after a week into fvwm.
- When called the first time, iconify all uniconified windows.
- When called the second time, restore the original set of windows and their stacking order.
Note that the “Thumbnail” function is not fast enough to preserve the stacking order. i.e. if the thumbnail function is used in place of iconify, once out of ten times the stacking order wouldn’t be preserved.
[code]
Key d A 4 ShowDesktop
AddToFunc StartFunction I Module FvwmEvent
DestroyModuleConfig FvwmEvent: *
*FvwmEvent: Cmd Function
*FvwmEvent: deiconify State4False
Toggle show desktop / restore
DestroyFunc ShowDesktop
AddToFunc ShowDesktop
- I Any (CurrentPage, State 4) ShowDesktop-deiconify
- I TestRc (NoMatch) ShowDesktop-iconify
DestroyFunc ShowDesktop-deiconify
AddToFunc ShowDesktop-deiconify
- I All Reverse UseStack (CurrentPage, State 4) Iconify
DestroyFunc ShowDesktop-iconify
AddToFunc ShowDesktop-iconify
- I All UseStack (CurrentPage, Iconifiable, !Iconic) State 4 True
- I All UseStack (CurrentPage, Iconifiable, !Iconic) Iconify
DestroyFunc State4False
AddToFunc State4False
- I All (CurrentPage) State 4 False[/code]
I learned in the forums that using state is a bad idea, but I can’t think of any other idea to flag windows for my current knowlegde level.