Hi All,
I noticed that other desktop managers (like KDE etc) do the following: When you change the current desktop / page, they give keyboard focus to a window on the current page. I like this a lot, and wrote the function below to acomplish the same in Fvwm. Ofcourse this only helps if you’re using ClickToFocus.
[code]SetEnv FocusPage 0
Remember focused window in current page
DestroyFunc SavePageFocus
AddToFunc SavePageFocus
- I All (CurrentPage) State $[FocusPage] False
- I Current State $[FocusPage] True
Restore previous focused window in current page (from fvwm-crystal)
DestroyFunc RestorePageFocus
AddToFunc RestorePageFocus
- I Current (CurrentPage) Break 1
- I Next (CurrentPage, State $[FocusPage]) Focus
- I None (CurrentPage, Focused) Prev (CurrentPage) Focus
*FvwmEvent: Cmd
*FvwmEvent: new_page RestorePageFocus
*FvwmEvent: focus_change SavePageFocus
[/code]
Finally add the line
+ I Module FvwmEvent
to your StartFunction, and you’ll be all set.
The only minor anoyence in the above is that if the current viewport has no windows, then the original window retains keyboard focus. (I don’t konw how to get around this). Also if the window with keyboard focus is only partly visible on the current page, sometimes the page is switched . Maybe you can either fix these bugs, or live with it [I’m content the way things are now]
HTH,
GI