focus problem after FvwmButton added

i have 2 problems with focus remember function. first is, when i send a window to ohter page then currently focus is still on that window. is it possible to refocus any other (or recent used) window on the current page?

Here is my focus remember functions:

[code]DestroyFunc CurrentPageFocusFunc
AddToFunc CurrentPageFocusFunc

  • I Current (!CurrentPage) Prev (CurrentPage) Focus NoWarp

DestroyFunc MarkWindowAsActiveFunc
AddToFunc MarkWindowAsActiveFunc

  • “I” Current (!Iconified) All (CurrentPage, !Focused) State 2 False
  • “I” Current (!Iconified) State 2 True

DestroyModuleConfig FvwmEvent: *
*FvwmEvent: Cmd Function
*FvwmEvent: new_page CurrentPageFocusFunc
*FvwmEvent: new_desk CurrentPageFocusFunc
*FvwmEvent: destroy_window CurrentPageFocusFunc
*FvwmEvent: focus_change MarkWindowAsActiveFunc
Module FvwmEvent[/code]

Another issue is about FvwmButtons. I added that button in StartFunction

+ I Module FvwmButtons MyPanel

and here is a scratch of MyPanel settings,styles:

[code]Style MyPanel NoTitle, Sticky, WindowListSkip, StaysOnBottom, NeverFocus, BorderWidth 1, HandleWidth 1, RoundedCorners
Style panel NoTitle, Sticky, WindowListSkip, CirculateSkipIcon, CirculateSkip
Style panel StaysOnBottom, NoHandles, BorderWidth 0
Style FvwmIconMan NoTitle, Sticky, WindowListSkip, CirculateSkipIcon, CirculateSkip
Style FvwmIconMan StaysOnBottom, NoHandles, BorderWidth 0
Style FvwmPager NoTitle, Sticky, WindowListSkip, CirculateSkipIcon, CirculateSkip
Style FvwmPager StaysOnBottom, NoHandles, BorderWidth 0

DestroyModuleConfig MyPanel: *
*MyPanel: Geometry 1360x40+20+3
*MyPanel: Rows 5
*MyPanel: Columns 102
*MyPanel: Colorset 20
*MyPanel: Font none
*MyPanel: (102x1)
*MyPanel: (1x3)
*MyPanel: (82x3, Swallow “FvwmIconMan”, “Module FvwmIconMan”)
*MyPanel: (8x3, Swallow (SwallowNew) “trayer” “Exec exec trayer
–SetDockType false
–widthtype pixel
–width 80
–heighttype pixel
–height 20
–alpha 10
–transparent true
–tint 0xffffff
–align left
–edge top”)

*MyPanel: (10x3, Swallow “FvwmPager”, “Module FvwmPager”)
*MyPanel: (1x3)
*MyPanel: (102x1)
[/code]

So the problem is that remember focus function doesn’t work well. Sometimes works but usually doesn’t. What is wrong?

Some of your Style lines have CirculateSkip in them which would get them ignored with most conditional commands you’re using in your remember focus functions.

– Thomas Adam

i removed these CircuateSkip from Styles. But nothing happen :frowning:

Also if i disable all buttons from the panel, that problem is still on.

I missed the bleeding obvious.

You have:

  • I Current (…)

But Current implies focus. Try using:

  • I ThisWindow (…)

Instead.

– Thomas Adam

I replaced Current to ThisWindow in both functions for remembering focus.
I removed CirculateSkip from Styles.

Still doesn’t work.

But you’re not being very specific. Look:

DestroyFunc CurrentPageFocusFunc
AddToFunc CurrentPageFocusFunc
+ I ThisWindow (!CurrentPage) Prev (CurrentPage, AcceptsFocus) Focus NoWarp

DestroyFunc MarkWindowAsActiveFunc
AddToFunc MarkWindowAsActiveFunc
+ "I" Current (!Iconified) All (CurrentPage, !Focused, AcceptsFocus) State 2 False
+ "I" Current (!Iconified) State 2 True

That’s what you want. This caters for windows which set NeverFocus since they can never be considered.

– Thomas Adam

[code]DestroyFunc CurrentPageFocusFunc
AddToFunc CurrentPageFocusFunc

  • I ThisWindow (!CurrentPage) Prev (CurrentPage, AcceptsFocus) Focus NoWarp

DestroyFunc MarkWindowAsActiveFunc
AddToFunc MarkWindowAsActiveFunc

  • “I” Current (!Iconified) All (CurrentPage, !Focused, AcceptsFocus) State 2 False
  • “I” Current (!Iconified) State 2 True

DestroyModuleConfig FvwmEvent: *
*FvwmEvent: Cmd Function
*FvwmEvent: new_page CurrentPageFocusFunc
*FvwmEvent: new_desk CurrentPageFocusFunc
*FvwmEvent: destroy_window CurrentPageFocusFunc
*FvwmEvent: focus_change MarkWindowAsActiveFunc
Module FvwmEvent[/code]

Style MyPanel NoTitle, Sticky, WindowListSkip, StaysOnBottom, NeverFocus, BorderWidth 1, HandleWidth 1, RoundedCorners Style panel NoTitle, Sticky, WindowListSkip Style panel StaysOnBottom, NoHandles, BorderWidth 0 Style FvwmIconMan NoTitle, Sticky, WindowListSkip Style FvwmIconMan StaysOnBottom, NoHandles, BorderWidth 0 Style FvwmPager NoTitle, Sticky, WindowListSkip Style FvwmPager StaysOnBottom, NoHandles, BorderWidth 0

doesn’t work ;(

You have:

DestroyFunc CurrentPageFocusFunc
AddToFunc CurrentPageFocusFunc
+ I ThisWindow (!CurrentPage) Prev (CurrentPage, AcceptsFocus) Focus NoWarp

You want:

+ I NoWindow Next(!CurrentPage) Prev (CurrentPage, AcceptsFocus) Focus NoWarp

We discussed this on IRC. Weren’t you listening?

– Thomas Adam

Not with me, Thomas :wink:
You missed a space between Next and first bracket. So, it works…but not very well.
If I switch between to page’s directly - works ok. if i switch to third page and then back, other window gets focus.

Yes, and it’s doing exactly as desired. There is yet to be a:

Psychic (SomeWindowYouMightKnowAbout) Focus NoWarp

– Thomas Adam