Subject: FVWM: AutoFocus on desk change

From: Max Ischenko <[email-masked]>
Date: Tue, 10 Apr 2001 10:51:14 +0300

I used to use SloppyFocus policy but today I decide to play with
ClickToFocus. I have a problem when switching to another page using
GotoPage command -- focus remains on last window. 

Is it possible to focus a
window on current page automatically?

-- 
BOFH excuse #28:
CPU radiator broken
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 10 Apr 2001 10:21:41 +0200

On Tue, Apr 10, 2001 at 10:51:14AM +0300, Max Ischenko wrote:
> Is it possible to focus a window on current page automatically?

You can either use desks instead of pages.  Each desk has its own
focused window and since recently keeping this window active
really works.  Or you can make a function:

  AddToFunc GotoPageAndFocus
  + I GotoPage $0 $1
  + I Next (CurrentPage) Focus

Then use this function instead of GotoPage everywhere.  However,
this does not work when scrolling the viewport or dragging windows
over the screen edge.  And if the pointer lands on a window (for
SloppyFocus or MouseFocus), the window may not gain focus.

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Max Ischenko <[email-masked]>
Date: Tue, 10 Apr 2001 12:29:51 +0300

>   + I Next (CurrentPage) Focus

Thanks, it works, albeit not perfectly.
> SloppyFocus or MouseFocus), the window may not gain focus.

I'd better go back to SloppyFocus. ;-)

-- 
Best regards, Maxim F. Ischenko.

---

From: Max Ischenko <[email-masked]>
Date: Tue, 10 Apr 2001 12:29:51 +0300

>   + I Next (CurrentPage) Focus

I use the following setup:

Style "*" BorderWidth 2, SloppyFocus

AddToFunc MyFocus 
+ "I" WindowId $w Raise
+ "I" WindowId $w FlipFocus

AddToFunc GotoPageAndFocus
+ I GotoPage $0 $1
+ I Next (CurrentPage) MyFocus

When there is exactly one window on a page it works perfectly -- that window
got the focus even if cursor not over it. OK.  Things goes badly when there
is more then one window on a page.  For example, if page 2 has three windows
on it they get selected in order when I switch to this page:
w1,w2,w3,w1, etc.

I want the same window to got the focus every time I switch to that page.
I 've tried 
+ I Next (CurrentPage Visible) MyFocus
+ I Next (CurrentPage Raised) MyFocus

but that doesn't work. Is it possible to do?