Subject: Re: FVWM: focus, again

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 19 Aug 2002 11:50:57 +0000

On 19 Aug 2002 11:13:13 +0200, Dominik Vogt wrote:
> 
> On Sun, Aug 18, 2002 at 01:21:48AM +0000, Mikhael Goikhman wrote:
> > On 17 Aug 2002 20:43:32 +0200, Giuseppe Della Ricca wrote:
> > > 
> > > I have a doubt from the man page:
> > > 
> > >               GrabFocus causes a newly  mapped  window  to
> > >               grab  the  focus,  while  GrabFocusOff turns
> > >               this off.   GrabFocus  is  the  default  for
> > >               ClickToFocus windows and GrabFocusOff is the
> > >               default for MouseFocus and SloppyFocus  win?
> > >               dows.   Note  that  this  option is switched
> > >               back to the default every  time  you  change
> > >               the  focus policy.  You have to use it after
> > >               the initial  ClickToFocus/MouseFocus/Sloppy?
> > >               Focus.
> > > 
> > > to me (non native English) this means that if I issue:
> > > 
> > > Style * ClickToFocus
> > > 
> > > than I automatically get GrabFocus for free. But experimentally this is
> > > not true (new windows are not raised/don't get focus).
> > > 
> > > Everything is fine if I issue:
> > > 
> > > Style * ClickToFocus, GrabFocus
> > > 
> > > but GrabFocus should be the default with ClickToFocus, or not ?
> 
> Ah yes.  I wasn't aware of the old behaviour and changed it.
> What should it do?  Reset GrabFocus or leave it as it was?

The old (well, the current in 2.4.x) behaviour is resetting GrabFocus/Off
on every ClickToFocus/SloppyFocus/MouseFocus/NeverFocus.

I think we may change this, i.e. use the explicitely set GrabFocus if any.
But then, I guess, we need a new command ClearStyle [option_list] to clear
GrabFocus/Off flag, i.e. use the default for it...

> > You forgot to say that you use the cvs version.
> > 
> > I can reproduce this problem, i.e. ClickToFocus does not set GrabFocus,
> > although I see in the code it does set.
> 
> It now only sets the default.  Once GrabFocus or GrabFocusOff is
> used, the default is ignored.

Well, try without config, do "Style some_xterm ClickToFocus", then start
xterm -n some_xterm, no GrabFocus. So the default is always ignored.

> > There is a more serious problem. With SloppyFocus/MouseFocus, GrabFocus
> > only works now when the pointer is on the root and not in the window.
> 
> I see no such problem.  Can you narrow down the config to make
> this happen?

I already managed to find that this is because of FvwmEvent a week ago,
but for some reason I thought it happens without it too. Minimal config:

  *FvwmEvent-NewWindow: PassId
  *FvwmEvent-NewWindow: add_window Something

  DestroyFunc Something
  AddToFunc   Something
  + I Next (bla-bla) Nop

  FvwmEvent FvwmEvent-NewWindow
  Style mywindow GrabFocus

  # now from FvwmConsole or another focused xterm with pointer in it:
  Exec xterm -n mywindow

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 19 Aug 2002 16:53:40 +0200

> > On Sun, Aug 18, 2002 at 01:21:48AM +0000, Mikhael Goikhman wrote:
[snip]

> xterm -n some_xterm, no GrabFocus. So the default is always ignored.

I see.  Does it work as expected if you remove the GrabFocusOff
and GrabFocusTransient styles from ConfigFvwmDefaults?  I don't
use that file myself.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, mail: [email-masked], phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 19 Aug 2002 17:16:25 +0200

>   # now from FvwmConsole or another focused xterm with pointer in it:

First, fvwm ignores the icon name of the window when looking up
the style, so the above line can never have worked.  Use

  Exec xterm -T mywindow
            ^^^^

instead.  With that, the window does get focus, but the focus is
taken away immediately.  It requires some digging to figure out
why that happens.

Bye

Dominik ^_^  ^_^

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 19 Aug 2002 15:26:49 +0000

> the style, so the above line can never have worked.  Use

Yes, of course, originally I used -name myself.

Regards,
Mikhael.

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 19 Aug 2002 15:27:43 +0000

> and GrabFocusTransient styles from ConfigFvwmDefaults?  I don't

If GrabFocusOff is removed from ConfigFvwmDefaults, the default logic
of GrabFocus works for the ClickToFocus window, but then GrabFocus
remains even if you change this style to MouseFocus/SloppyFocus.

  Style mywindow ClickToFocus
  Style mywindow MouseFocus

is equivalent to:

  Style mywindow GrabFocus

and the reverse order is still equivalent to setting GrabFocus.

Regards,
Mikhael.

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 19 Aug 2002 15:35:43 +0000

> Yes, of course, originally I used -name myself.

Actually, this is not what I wanted to say.

All 3 work. -n is even stronger than -T.
Window name does work for style matching. :)

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 19 Aug 2002 17:52:55 +0200

> and the reverse order is still equivalent to setting GrabFocus.

Fixed.

Bye

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 19 Aug 2002 17:57:18 +0200

> Window name does work for style matching. :)

Um, from the xterm man page:

       -n string
               This  option  specifies  the icon name for xterm's
               windows.   It  is  shorthand  for  specifying  the
               ``*iconName'' resource.  Note that this is not the
               same as the toolkit option -name (see below).  The
               default icon name is the application name.

I can't confirm that -n works with styles, and according to the
code it shouldn't.  -name and -T do work, though.

Bye

Dominik ^_^  ^_^

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 19 Aug 2002 16:40:30 +0000

> code it shouldn't.  -name and -T do work, though.

My man page tells the same. But the fact is that both window name and icon
name are set using -n for me. I remember this xterm behaviour for years.
Removing XTerm and .Xdefaults does not help, -n and XTerm*iconName
just set the window name as well. With xterm-166 built from sources too.

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 19 Aug 2002 18:46:37 +0200

> name are set using -n for me. I remember this xterm behaviour for years.

Yes, I remember this.  Seems that it finally got fixed.

  $ xterm -version
  XFree86 4.1.0(165)

Bye

Dominik ^_^  ^_^

---

From: Bob Woodside <[email-masked]>
Date: Mon, 19 Aug 2002 13:05:28 -0400

On Mon, 19 Aug 2002 17:57:18 +0200

> code it shouldn't.  -name and -T do work, though.

	My version of xterm, at least, seems to set the Name to the same value as the
Icon Name specified with -n, unless you also gave it the -name or -T or -title
arguments. But I digress....

Cheers,
Bob

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 20 Aug 2002 22:19:14 +0200

Fixed.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 21 Aug 2002 12:25:42 +0000

> >   # now from FvwmConsole or another focused xterm with pointer in it:

Thank you. I used a lot to type in the Find dialog without pointer in it.
That habit often screwed my browser, because it understands English
latters to do some kind of zooming, selecting, style sheet switching. :)

Regards,
Mikhael.