Discussion:
FVWM: Focus after Iconify
Walter Alejandro Iglesias
2012-05-27 15:31:56 UTC
Permalink
Hello,

I use ClickToFocus and just IconMan, I don't use icons.

When I iconify a window I expect the last focused window
recovers the focus. It happens just randomly.

I use the default Iconify function. I've tried adding custom
functions (following what I've found in some posts in the Fvwm
forum about similar issues) without success. Perhaps I don't
understand well what Fvwm saves for Prev and Next windows; is this
managed by FvwmWindowList function?

Thanks in advance.

Walter
Jonathan Kotta
2012-05-27 18:19:15 UTC
Permalink
On Sun, May 27, 2012 at 10:31 AM, Walter Alejandro Iglesias
Post by Walter Alejandro Iglesias
Hello,
I use ClickToFocus and just IconMan, I don't use icons.
When I iconify a window I expect the last focused window
recovers the focus.  It happens just randomly.
I use the default Iconify function.  I've tried adding custom
functions (following what I've found in some posts in the Fvwm
forum about similar issues) without success.  Perhaps I don't
understand well what Fvwm saves for Prev and Next windows; is this
managed by FvwmWindowList function?
Thanks in advance.
       Walter
I also use ClickToFocus, and use FvwmEvent to switch focus when
iconifying. It works well for me.

,----
| DestroyFunc FocusPrev
| AddToFunc FocusPrev
| + I None (CurrentPage, Focused, AnyScreen) \
| Prev (CurrentPage, !Iconic, !Shaded, Visible, AcceptsFocus, AnyScreen) \
| Focus NoWarp
|
| DestroyModuleConfig FvwmEventFocus: *
| *FvwmEventFocus: Cmd Function
| *FvwmEventFocus: new_page FocusPrev
| *FvwmEventFocus: new_desk FocusPrev
| *FvwmEventFocus: destroy_window FocusPrev
| *FvwmEventFocus: iconify FocusPrev
|
| KillModule FvwmEvent FvwmEventFocus
| FvwmEvent FvwmEventFocus
`----
--
Thanks,

Jonathan Kotta

Hofstadter's Law:
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.
Walter Alejandro Iglesias
2012-05-27 19:05:24 UTC
Permalink
Post by Jonathan Kotta
On Sun, May 27, 2012 at 10:31 AM, Walter Alejandro Iglesias
Post by Walter Alejandro Iglesias
Hello,
I use ClickToFocus and just IconMan, I don't use icons.
When I iconify a window I expect the last focused window
recovers the focus.  It happens just randomly.
I use the default Iconify function.  I've tried adding custom
functions (following what I've found in some posts in the Fvwm
forum about similar issues) without success.  Perhaps I don't
understand well what Fvwm saves for Prev and Next windows; is this
managed by FvwmWindowList function?
Thanks in advance.
       Walter
I also use ClickToFocus, and use FvwmEvent to switch focus when
iconifying. It works well for me.
,----
| DestroyFunc FocusPrev
| AddToFunc FocusPrev
| + I None (CurrentPage, Focused, AnyScreen) \
| Prev (CurrentPage, !Iconic, !Shaded, Visible, AcceptsFocus, AnyScreen) \
| Focus NoWarp
|
| DestroyModuleConfig FvwmEventFocus: *
| *FvwmEventFocus: Cmd Function
| *FvwmEventFocus: new_page FocusPrev
| *FvwmEventFocus: new_desk FocusPrev
| *FvwmEventFocus: destroy_window FocusPrev
| *FvwmEventFocus: iconify FocusPrev
|
| KillModule FvwmEvent FvwmEventFocus
| FvwmEvent FvwmEventFocus
`----
--
Thanks,
Jonathan Kotta
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.
Hy Jonathan

Should I add this function to a custom version of Iconify?
Jonathan Kotta
2012-05-29 17:23:57 UTC
Permalink
On Sun, May 27, 2012 at 2:05 PM, Walter Alejandro Iglesias
Post by Walter Alejandro Iglesias
Post by Jonathan Kotta
On Sun, May 27, 2012 at 10:31 AM, Walter Alejandro Iglesias
Post by Walter Alejandro Iglesias
Hello,
I use ClickToFocus and just IconMan, I don't use icons.
When I iconify a window I expect the last focused window
recovers the focus.  It happens just randomly.
I use the default Iconify function.  I've tried adding custom
functions (following what I've found in some posts in the Fvwm
forum about similar issues) without success.  Perhaps I don't
understand well what Fvwm saves for Prev and Next windows; is this
managed by FvwmWindowList function?
Thanks in advance.
       Walter
I also use ClickToFocus, and use FvwmEvent to switch focus when
iconifying.  It works well for me.
,----
| DestroyFunc FocusPrev
| AddToFunc FocusPrev
| + I None (CurrentPage, Focused, AnyScreen) \
|     Prev (CurrentPage, !Iconic, !Shaded, Visible, AcceptsFocus, AnyScreen) \
|     Focus NoWarp
|
| DestroyModuleConfig FvwmEventFocus: *
| *FvwmEventFocus: Cmd Function
| *FvwmEventFocus: new_page       FocusPrev
| *FvwmEventFocus: new_desk       FocusPrev
| *FvwmEventFocus: destroy_window FocusPrev
| *FvwmEventFocus: iconify        FocusPrev
|
| KillModule FvwmEvent FvwmEventFocus
| FvwmEvent FvwmEventFocus
`----
--
Thanks,
Jonathan Kotta
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.
Hy Jonathan
Should I add this function to a custom version of Iconify?
Sounds like you got it working, but I'll follow up anyway. You don't
need to define your own version of Iconify. With the snippet I
posted, FvwmEvent runs FocusPrev every time a window is iconified (and
also whenever a window is destroyed, or the page or desk is changed).
--
Thanks,

Jonathan Kotta

Hofstadter's Law:
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.
Walter Alejandro Iglesias
2012-05-29 20:30:05 UTC
Permalink
Post by Jonathan Kotta
On Sun, May 27, 2012 at 2:05 PM, Walter Alejandro Iglesias
Post by Walter Alejandro Iglesias
Post by Jonathan Kotta
On Sun, May 27, 2012 at 10:31 AM, Walter Alejandro Iglesias
Post by Walter Alejandro Iglesias
Hello,
I use ClickToFocus and just IconMan, I don't use icons.
When I iconify a window I expect the last focused window
recovers the focus.  It happens just randomly.
I use the default Iconify function.  I've tried adding custom
functions (following what I've found in some posts in the Fvwm
forum about similar issues) without success.  Perhaps I don't
understand well what Fvwm saves for Prev and Next windows; is this
managed by FvwmWindowList function?
Thanks in advance.
       Walter
I also use ClickToFocus, and use FvwmEvent to switch focus when
iconifying.  It works well for me.
,----
| DestroyFunc FocusPrev
| AddToFunc FocusPrev
| + I None (CurrentPage, Focused, AnyScreen) \
|     Prev (CurrentPage, !Iconic, !Shaded, Visible, AcceptsFocus, AnyScreen) \
|     Focus NoWarp
|
| DestroyModuleConfig FvwmEventFocus: *
| *FvwmEventFocus: Cmd Function
| *FvwmEventFocus: new_page       FocusPrev
| *FvwmEventFocus: new_desk       FocusPrev
| *FvwmEventFocus: destroy_window FocusPrev
| *FvwmEventFocus: iconify        FocusPrev
|
| KillModule FvwmEvent FvwmEventFocus
| FvwmEvent FvwmEventFocus
`----
--
Thanks,
Jonathan Kotta
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.
Hy Jonathan
Should I add this function to a custom version of Iconify?
Sounds like you got it working, but I'll follow up anyway. You don't
need to define your own version of Iconify. With the snippet I
posted, FvwmEvent runs FocusPrev every time a window is iconified (and
also whenever a window is destroyed, or the page or desk is changed).
--
Thanks,
Jonathan Kotta
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.
Hi, Jonathan

I'd tried adding your function and activating FvwmEvent module
but the issue was still there. More late I released that neither
what I said in my last post had fixed it.

What finally worked was a little change I did in the function I use
for mouse actions on IconMan. Time ago I read this post:

http://www.fvwmforums.org/phpBB3/viewtopic.php?f=33&t=1933

and after trying some changes I got the function I was using till now:

DestroyFunc IconManClicked
AddToFunc IconManClicked
+ I ThisWindow (Iconic) Iconify
+ I TestRc (Match) Break
+ I ThisWindow (Focused) Iconify
+ I TestRc (Match) Break
+ I ThisWindow (!Focused) Focus
+ I TestRc (!Match) Break
+ I ThisWindow Raise

But for some reason, randomly selecting windows by clicking on the
iconman several times at some point altered the focus order. Now
I've changed it for this:

DestroyFunc IconManClicked
AddToFunc IconManClicked
+ I ThisWindow (Iconic) Iconify
+ I TestRc (Match) Break
+ I ThisWindow (Focused) Iconify
+ I TestRc (Match) Break
+ I ThisWindow (!Focused) FlipFocus
+ I TestRc (!Match) Break
+ I ThisWindow Raise

and problem solved. It was replacing Focus for FlipFocus the
magic touch.


Salu2

Walter

Thomas Adam
2012-05-27 19:10:28 UTC
Permalink
Post by Jonathan Kotta
| KillModule FvwmEvent FvwmEventFocus
| FvwmEvent FvwmEventFocus
Rather:

AddToFunc StartFunction I Module FvwmEvent FvwmEventFocus

-- Thomas Adam
Walter Alejandro Iglesias
2012-05-28 11:26:45 UTC
Permalink
I've found my error. I used:

DestroyFunc FuncIconifyAndFocusPrev
AddToFunc FuncIconifyAndFocusPrev
+ I Prev (AcceptsFocus, CurrentPage, !Iconic) Focus
+ I Prev (AcceptsFocus, CurrentPage, !Iconic) Raise
+ I Iconify on

for the title iconify button. But for some reason (I don't
remember why I included this option) I had this:

Style * CirculateSkip, CirculateSkipIcon

in my general style options, that's why the above didn't work.
After removing it, all works like expected.

Thanks

Walter


PD: If you include my address in Carbon Copy I receive your
message twice.
Loading...