Style * MouseFocus
#Style * ClickToFocus
AddToFunc PrevOrNext
+ I Current ($$0) Prev (AcceptsFocus) FlipFocus
+ I TestRc (NoMatch) Next ($$0) FlipFocus
Key V A 4 PrevOrNext gvim
Key L A 4 PrevOrNext leafpad
Key U A 4 PrevOrNext urxvt
Focus on leafpad, press “mod4+L” twice, I hope to focus on the very last focused window the first time , then focus back on leafpad.
Using above config, I find “MouseFocus” works while “ClickToFocus” doesn’t.
To make it clear, following are my tests:
leafpad, urxvt and gvim on the same desk Both “MouseFocus” and “ClickToFocus” work well.
leafpad and urxvt on desk1; gvim on desk2
Follow these steps:
goto desk2; focus on gvim; move mouse to somewhere it won’t cover any of the three window;
press “mod4+L”; press “mod4+U”; press “mod4+V”.
Then the internal order of windows should be: [gvim–>urxvt–>leafpad].
Now press “mod4+L” twice: I wish focus on leafpad first, then focus back on gvim.
As I’ve said, “MouseFocus” works while “ClickToFocus” doesn’t.
(Use “ClickToFocus”, the second time press “mod4+L” will focus on urxvt other than gvim.
That is ,the first time press “mod4+L”, window order changed to [leafpad–>urxvt–>gvim]
other than [leafpad–>gvim–>urxvt] )
Personally I prefer the ClickToFocus style, I wish to find a solution to fix this problem.
Now I’m sure my problem is aroused by desk changing.
Assuming that current window list as follow:
gvim (desk1)
urxvt (desk0)
leafpad (desk0)
firefox (desk0)
Now ‘FlipFocus’ on leafpad
Using “ClickToFocus” new_desk event prints:
urxvt (desk0)
gvim (desk1)
leafpad (desk0)
firefox (desk0)