SmartFocus Function


The following is a set of functions which I use to help navigate my 5x1 desktop layout. I don’t like to use the mouse unless required, and I have keybindings to move me left and right across my desktop. I have encountered a problem, which was primarily solved by Thomas (thank you!), wherein the mouse pointer is not over a window after moving virtual terminals. With my focus setup requiring the mouse to be in a window before the focus changes, I can be forced to manually place the mouse onto the one a window, which seems a wasted effort.

FVWM to the rescue, voila!

[code]DestroyFunc GotoPageAndFocus
AddToFunc GotoPageAndFocus

  • I GotoPage $*
  • I PointerWindow (HasPointer) Break
  • I Next (CurrentPage, AcceptsFocus, !Focused, CirculateHit) FlipFocus

DestroyFunc GotoPage-Left
AddToFunc GotoPage-Left

  • I GotoPageAndFocus wrapx -1p +0p

DestroyFunc GotoPage-Right
AddToFunc GotoPage-Right

  • I GotoPageAndFocus wrapx +1p +0p

This could easily be extended to include vertical viewports if you run a different layout… Once again, thank you Thomas Adam! :stuck_out_tongue: