Subject: 2.5.11 - Switching to last focused not working....

From: Parv <[email-masked]>
Date: Sun, 3 Oct 2004 00:04:27 -0400

I used to be able to switch to thee last focused predictably &
consistently in 2.5.10 w/ the following functions & key binding...

  key f  A   4  Function switch-to-last

  DestroyFunc  WindowListFunc
  AddToFunc    WindowListFunc
  +  I Iconify false
  +  I WindowShade false
  +  I Raise
  +  I FlipFocus
  +  I WarpToWindow 50 50

  DestroyFunc  window-list
  AddToFunc    window-list
  +  I WindowList Root c c Sticky,  OnTop \
    NoGeometryWithInfo  NoDeskNum  NoNumInDeskTitle \
    MaxLabelWidth 30 IconifiedAtEnd \
    $*

  DestroyFunc  switch-to-last
  AddToFunc    switch-to-last
  +  I Function window-list  SelectOnRelease Super_L

In 2.5.11 i am at loss to know in advance if i would get the last
focused window.  Above generates only the window list; no window is
selected on release of Super_L.

I see a line is mentioned in the "News" section on fvwm.org about
changes to WindowList, but nothing helpful for me.  I also tried the
following 3 versions, bounded to "tab M", as hinted in the FAQ & the
man page....

  key Tab A M switch-other-gui-2

  DestroyFunc  switch-other-gui-0
  AddToFunc    switch-other-gui-0
  + I WindowList \
      Root c c CurrentDesk , NoGeometry \
      Prev (CurrentDesk) WindowListFunc

  DestroyFunc  switch-other-gui-1-prev
  AddToFunc    switch-other-gui-1-prev
  + I Prev (CurrentDesk) WindowListFunc

  DestroyFunc  switch-other-gui-1
  AddToFunc    switch-other-gui-1
  + I WindowList \
      Root c c \
      , CurrentDesk , NoGeometryWithInfo , CurrentAtEnd ,  IconifiedAtEnd \
      , SelectOnRelease Alt_L \
        Function switch-other-gui-1-prev

  DestroyFunc  switch-other-gui-2
  AddToFunc    switch-other-gui-2
  + I WindowList \
      Root c c \
      , NoGeometryWithInfo , CurrentAtEnd ,  IconifiedAtEnd , NoDeskNum
      , NoNumInDeskTitle , SelectOnRelease Alt_L
      Prev (CurrentDesk)

Am i doing anything wrong wrt WindowList in v2.5.11?

  - Parv
-- 

--
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, 4 Oct 2004 02:11:58 +0200

>   +  I WindowList Root c c Sticky,  OnTop \

Note: options should be separated by commas.  Whitespace
separators may stop working some day in the future.

> focused window.

> Above generates only the window list; no window is

Because the currently focused window is the first entry in the
list.  This config should never have worked (and it does not work
here with 2.5.10).  If it did, I don't understand why.  You need
to have the window that had the focus last at the top of the list.
The CurrentAtEnd option provides this feature.  Adding
"CurrentAtEnd" right before $"*" makes above config work for me.

If that does not help, post a minimal config that shows the
problem.

> changes to WindowList, but nothing helpful for me.

There have been no WindowList changes since 2.5.10.  The NEWS line
refers to the perl library.

[snip]

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]

---

From: Parv <[email-masked]>
Date: Sat, 9 Oct 2004 02:19:36 -0400

in message <[email-masked]>,
wrote fvwm-w thusly...
> separators may stop working some day in the future.

(Fvwm 2.5.12 & 2.5.10 are being compared below.)

In both 2.5.10 & 2.5.12, use of commas to separate the options causes
the WindowList to appear with full geometry information and
SelectOnRelease has not effect.  It is as if WindowList was invoked
w/o any parameters.  I tried 3 variations ...

  DestroyFunc  window-list
  AddToFunc    window-list
  +  I WindowList Root c c Sticky \
    , OnTop   NoGeometryWithInfo   NoDeskNum    NoNumInDeskTitle \
      MaxLabelWidth 30   IconifiedAtEnd    CurrentAtEnd \
      $*

  DestroyFunc  window-list
  AddToFunc    window-list
  +  I WindowList Root c c Sticky \
    , OnTop , NoGeometryWithInfo , NoDeskNum , NoNumInDeskTitle \
    , MaxLabelWidth 30 , IconifiedAtEnd , CurrentAtEnd \
    , $*

  DestroyFunc  window-list
  AddToFunc    window-list
  +  I WindowList Root c c Sticky \
      OnTop , NoGeometryWithInfo , NoDeskNum , NoNumInDeskTitle \
    , MaxLabelWidth 30 , IconifiedAtEnd , CurrentAtEnd \
    , $*

In 2.5.12, following syntax brings up WindowList w/ "Desk: 0" title,
current window at the end, and rest of windows in focus-LIFO order...

  DestroyFunc  window-list
  AddToFunc    window-list
  +  I WindowList Root c c Sticky \
      OnTop   NoGeometryWithInfo   NoDeskNum   NoNumInDeskTitle \
      MaxLabelWidth 30   IconifiedAtEnd   CurrentAtEnd \
      $*

> >   +  I Function window-list  SelectOnRelease Super_L
...
> > Above generates only the window list; no window is selected on
> > release of Super_L.
> 
> This config should never have worked (and it does not work here with
> 2.5.10) ...  You need to have the window that had the focus last at
> the top of the list.  The CurrentAtEnd option provides this feature.

You are quite correct about the use of CurrentAtEnd, of course.
During experimenting w/ the odd focusing behaviour of version 2.5.11,
i forgot to add it in one place or the other.

> If that does not help, post a minimal config that shows the

There definitely is(are) some change(s), related to Style/focus, which
affects the order of WindowList which was missing from 2.5.10 but
is(was) present in 2.5.12(2.5.11).

Below is the the combined configuration snippet w/ working functions
(as i desire) but apparently in incorrect syntax, and problem causing
style definition(s).

 - Parv

####  K E Y  B I N D I N G

key l  A    4  Function window-list-sorted
key Tab  A  4  Popup root-menu

key Left   A    4  GotoPage -1p  0p
key Right  A    4  GotoPage +1p  0p
key Up     A    4  GotoPage  0p -1p
key Down   A    4  GotoPage  0p +1p

key F7  T  A  Function deiconify-func RaiseLower
key F7  W  S  Function deiconify-func RaiseLower
key F7  A  4  Pick deiconify-func RaiseLower

key F12  A  S  Restart

####  F U N C T I O N S

DestroyFunc  StartFunction
AddToFunc    StartFunction
+ I Module FvwmAuto 2050 Raise
+ I Module FvwmAuto * StartsOnPage 0 1
+ I Module FvwmPager * *
+ I Module FvwmDebug --log /home/parv/log/misc/fvwm.debug -d 4

# For some SM-s (like gnome-session) there is an internal background setter.
AddToFunc    SessionInitFunction
+  I Nop

DestroyFunc  EWMHActivateWindowFunc
AddToFunc    EWMHActivateWindowFunc
+  I WindowListFunc

DestroyFunc  WindowListFunc
AddToFunc    WindowListFunc
+  I Function deiconify-func Raise
+  I FlipFocus
+  I WarpToWindow 50 50

DestroyFunc  window-list
AddToFunc    window-list
+  I WindowList Root c c Sticky \
    OnTop   NoGeometryWithInfo   NoDeskNum   NoNumInDeskTitle \
    MaxLabelWidth 30   IconifiedAtEnd   CurrentAtEnd \
    $*

DestroyFunc  deiconify-func
AddToFunc    deiconify-func
+  I Iconify false
+  I WindowShade false
+  I $0

DestroyMenu  root-menu
AddToMenu    root-menu  "holy cow!"  Title
+  &xvt           Exec $XVT
+  ""             Nop
+  &restart       Restart
+  "start tvtwm"  Restart tvtwm -f ${HOME}/cf/x/tvtwm.cf
+  "start twm"    Restart twm
+  &quit          Quit
+  ""             Nop
+  &kill          Function xkill

####  S T Y L E S

Style  *  FPLenient \
  , FPClickRaisesFocused      , FPClickRaisesUnfocused \
  , FPClickDecorRaisesFocused , FPClickDecorRaisesUnfocused \
  , FPClickIconRaisesFocused  , FPClickIconRaisesUnfocused \
  , FPGrabFocus , FPReleaseFocus \
  , FPAllowRaiseClickFunction \
  , ClickToFocusPassesClickoff \
  , ClickToFocusRaises , MouseFocusClickRaises \
  , FPFocusByFunctionWarpPointer \
  , MouseFocus

Style *  DecorateTransient \
  , DontLowerTransient \
  , RaiseTransient \
  , StackTransientParent \
  , StartsOnPageIncludesTransients

Style  *  MinOverlapPercentPlacement
Style  *  MinOverlapPercentPlacementPenalties   3 1 0 0

Style  new-focus  MouseFocusClickRaises , ClickToFocusRaises , GrabFocus \
  , DontLowerTransient , RaiseTransient , GrabFocusTransient

Style  XTerm Color grey75/dodgerblue4 , HandleWidth 2 \
  , StartsRaised , TitleAtRight , UseStyle new-focus , GrabFocus

Style  Fvwm*  Sticky , Layer 4 , NoHandles , WindowListHit , !Borders \
  , SloppyFocus , !Maximizable , StartsLowered \
  , ParentalRelativity

--

---

From: Parv <[email-masked]>
Date: Sat, 9 Oct 2004 02:43:33 -0400

in message <[email-masked]>,
wrote Parv thusly...
> (Fvwm 2.5.12 & 2.5.10 are being compared below.)

Forgot "fvwm -v" ...

  fvwm 2.5.10 compiled on Oct  2 2004 at 23:24:15
  with support for: ReadLine, XPM, PNG, Shape, XShm, XRender

  fvwm 2.5.12 compiled on Oct  8 2004 at 23:08:59
  with support for: ReadLine, XPM, PNG, Shape, XShm, XRender

  - Parv

--

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 9 Oct 2004 14:20:57 +0200

On Sat, Oct 09, 2004 at 02:19:36AM -0400, Parv wrote:
> SelectOnRelease has not effect.

There is a bug in some of the parsing functions.  In the
WindowList (and possibly some other commands) there must not be
any whitespace before the comma (it works with the Style command,
though).

[snip]

> current window at the end, and rest of windows in focus-LIFO order...

Is that the order you want or is it not?

--

I completely rewrote the focus code in 2.5.3, introducing all the
FP... styles.  Not using CTF myself, I believed to remember that
CFT sorted windows in order of creation, not in the order of last
focus.  I noticed this some time ago, and CTF behaves properly
since 2.5.9.  Said behaviour can be activated with

  Style * !FPSortWindowlistByFocus

In any case, I consider the focus handling code stable since 2.5.9
and very quirky from 2.5.3 and 2.5.8.

[snip]
 
> affects the order of WindowList

> which was missing from 2.5.10 but is(was) present in
> 2.5.12(2.5.11).

Can you say that again?  What was missing in 2.5.10?

>   , FPFocusByFunctionWarpPointer \

You should be aware that the maximum command length in fvwm is
1024 bytes.  If you keep adding styles to this list you might hit
that limit at around 30 lines in the style definition.

Ciao

Dominik ^_^  ^_^

---

From: Parv <[email-masked]>
Date: Sat, 9 Oct 2004 15:22:26 -0400

in message <[email-masked]>,
wrote fvwm-w thusly...
> > In both 2.5.10 & 2.5.12, use of commas to separate the options
> > causes the WindowList to appear with full geometry information
> > and SelectOnRelease has not effect.
> 

Just to clarify ... "no whitespace before the comma" is a bug in
parsing functions and is not a syntax requirement?

Could you please provide an example demonstrating line
continuations, proper placement of commas, use of position, options,
and mouse action?

Speaking of syntax example, it would be swell if there were BNF(-like)
definitions for all the syntax.  Alternatively, display the syntax bit
more explicitly.  For example...

  MenuStyle stylename options

  ...would be changed to ...

  MenuStyle <stylename> <option [, option] [, option ] ...>

  ...where <word> implies a word is required & [word] implies word is
  optional.

> > In 2.5.12, following syntax brings up 

Argh, my fault; i meant to write 2.5.10 not 2.5.12.

> > WindowList w/ "Desk: 0" title, current window at the end, and
> > rest of windows in focus-LIFO order...
> 

Yes, i do want the list in the order mentioned.

> > There definitely is(are) some change(s), related to Style/focus,
> > which affects the order of WindowList
> 

Something that is in 2.5.12 but was not in 2.5.10 that affects the
order in WindowList, well, list; result is NOT "current-at-end,
rest-LIFO-order-based-on-focus" sorting in 2.5.12.

Sorry for the vagueness, but that's the behaviour difference i
observed and am not able to pinpoint the specifics.

> that limit at around 30 lines in the style definition.

I thought about that (as converting the above syntax w/ line
continuations to "Style * " for each line undid some problem that
turned out to be a red herring).

Thanks for pointing that out explicitly.  Could a note be added to the
man page?

  - Parv

--

---

From: Parv <[email-masked]>
Date: Sat, 9 Oct 2004 19:58:08 -0400

in message <[email-masked]>,
wrote Parv thusly...
> > 1024 bytes.  If you keep adding styles to this list you might
> > hit that limit at around 30 lines in the style definition.
> 

Not a herring after all!  After breaking up the above Style thusly ...

  Style  *  FPLenient \
    , FPAllowRaiseClickFunction

  Style * ClickToFocusPassesClickoff , ClickToFocusRaises \
    , MouseFocusClickRaises , MouseFocus

... in 2.5.12, WindowList is making the list in the desired order just
like it does in 2.5.10 (w/ or w/o both combined).  Combining the two
styles does cause the problem (in 2.5.12).  Thanks Dominik.

BTW, comma placement has no effect on the order.  I understand that
the situation may change in future as Dominik has pointed out in this
thread and also previously in various threads.

  - Parv

--

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 10 Oct 2004 15:49:36 +0200

On Sat, Oct 09, 2004 at 07:58:08PM -0400, Parv wrote:
> .... in 2.5.12, WindowList is making the list in the desired order just

That feels lika a bug int the style merging code.

I still don't know exactly what behaviour you see. In which order
do you get the window list:

  - with 2.5.10,
  - with 2.5.12 and a sing style line,
  - with 2.5.12 and multiply style lines?

With the config you posted earlier, I get exactly the same
(correct) order with 2.5.10, 2.5.12 and current CVS, regardless of
whether I split the style lione or not.

--

> BTW, comma placement has no effect on the order.

No, and that will never change.

> I understand that the situation may change in future as Dominik
> has pointed out in this thread and also previously in various
> threads.

When (if) I change it, it won't affect the order.  Style lists
without commas will simply stop working.

Ciao

Dominik ^_^  ^_^