I’ve searched through the forum and found some related posts. One theory is that these unpredictable beaviour is due to some ‘applets’ (such as xclock, pager, etc.) not being set as CirculateSkip. But in my test setup, there aren’t any ‘applet’ on the desktop, not even a pager.
I even thought about examining the source code and disable the stock ‘hand-out-focus-upon-iconify’ behaviour, so that I can implement my own algorithm in the configuration, without the interference from the built-in behaviour.
Could anyone help me out? This is really a confusing situation.
Open 3 windows, rapidly press F2 to cycle iconify/deiconify between all 3 of them, as described in the first post
Switch to another page
Open 3 windows, Now I cannot cycle through these 3 windows as in step 2. After iconifying the last window, focus goes nowhere.
Go back to the previous page, now I cannot cycle through the previously opened 3 windows either.
The behaviour is the same as in step 4.
It seems as if the window ring is ‘broken’. If I deiconify the first window then rapidly press F2, I can go no further than the 3rd window. If I deiconify the 3rd window first, I cannot switch to any window at all. (presumably because this is the end of the list since the ring looks like a list now)
I have felt that way too, altho perhaps for different reasons. Situations like when a window is closed, yet no other windows on the desktop received focus afterwards. Or where the focused window and the raised window are not exactly the same.
You are obviously looking for a consistent focus behavior. But you haven’t stated exactly what that desired behavior is. I mean, if the fvwm focus is slightly broken, perhaps the right question is how to fix it? And you shouldn’t have to hack the source code to do this.
In my own case, I have used FvwmEvent to ensure that no iconified window is ever focused. And to ensure that a no-focus situation never arises whilst there are focusable windows on the desktop.
PS. I too have observed that the order of the window ring is sometimes not preserved. In my case, non-iconified windows always retain their order. But the order of iconified windows in the Windowlist is sometimes unexpected. Didn’t give it much thought until now. Do you use the PlaceAgain command?
First, thank you very much for taking time to read my posts.
In fact, I’ve already tweaked Iconify() in icons.c (It uses restore_focus_after_unmap() from focus.c to give focus to another window)
My tweak works to some extent, but obviously introduced a lot more problems since I’m not familliar with programming at all.
My desired behaviour is to give focus to “the next window” upon iconify, so that the focus would cycle through all windows.
In my setup I mapped F2 to iconify/de-iconify windows. In an ideal setup, I can press F2 in an rapid succession to cycle through all windows.
In fact, FVWM almost behaves like that, it’s just the inconsistencies that prevented it from working all the time. For example, it’s working fine after a fresh start, but after a page switch it began to act erratically.
And because of the inconsistencies, it’s very hard to repair the behaviour in the config. I guess any custom focus policy tweaks only happen after the built-in behaviour has completed. So if the build-in behaviour is unpredictable, the final result cannot stay persistent either.
Thanks for the tip! You reminded me of a new way to fix this. Maybe I can first de-focus all windows, then focus the one I want. I’ll take a look in my spare time.
I havent used that command before since I only started using fvwm for less than a week. Thanks for your various tips which are invaluable to a newbie like me.
PS. I have been an xfce user for the past few years until the recent gtk±3.20 update broke nearly all the themes, focing me to find an alternative.
So I tend to believe this could be a long-existing problem hiding in fvwm. It’s seldom discovered because most user would not use Style * ClickToFocus.
With FocusFollowsMouse or SloppyFocus, this problem becomes a lot less noticeable.
Found a little problem with it together with “quake” style drop down terminal managed by FVWM: when quake terminal shutters back, but I did started a program from it earlier and it’s window appeared, it gets defocused and some previous window in background gets focus. How I can tell it not to do that? Is there a window hierarchy tree match possible? I know little of X11 internals, so please don’t blame me much. My current FVWM config (without this style, forget DeleteFocus commands - they’re my personal hack 8) ).
Personally I’m using this together with drop-down terminal managed by FVWM too,
and have no problems at all. Here is my drop-down terminal function:
+ I None ($1, CurrentDesk) Exec exec $0
+ I All ($1, Focused, !Maximized) ResizeMove $2 $3 $4 $5
+ I All ($1, CurrentDesk, Iconic) Iconify false
+ I TestRc (!Match) All ($1, !Focused) Raise
+ I TestRc (!Match) All ($1) Iconify true
+ I All ($1) FlipFocus