Re: FVWM: Building a decent Panel?

From: Dominik Vogt <fvwm_at_fvwm.org>
Date: Tue, 15 Apr 2003 17:14:34 +0200

On Tue, Apr 15, 2003 at 08:56:16AM +0000, Mikhael Goikhman wrote:
> On 15 Apr 2003 10:41:43 +0200, Dominik Vogt wrote:
> >
> > On Mon, Apr 14, 2003 at 07:44:20PM +0000, Mikhael Goikhman wrote:
> > > On 14 Apr 2003 17:50:11 +0200, Dominik Vogt wrote:
> > > >
> > > > AddToFunc enter_handler
> > > > + I autohide $0 FvwmButtons 500 SW
> > > > # ^ ^ ^
> > > > # | | |___ Shade direction (optional)
> > > > # | |_______ Hide delay
> > > > # |___________________ Unique window name/resource
> > > >
> > > > AddToFunc autohide
> > > > + I WindowId $0 ($1) Deschedule $0
> > > > + I WindowId $0 ($1) ThisWindow (shaded) WindowShade off
> > > > + I CondCase (!Match) All (!shaded, $1) autohide_hide $$$$$$$w $2 $3
> > > >
> > > > AddToFunc autohide_hide
> > > > + I Deschedule $0
> > > > + I Schedule $1 $0 WindowShade $2
> > > >
> > > > AddToFunc StartFunction
> > > > + I Module FvwmAuto FvwmAutohide -passid -menter enter_handler
> > >
> > > This is nice. Just a note, this requires the latest cvs to run.
> > > I am not quite sure why the number of dollars is 7 instead of 8 here.
> >
> > Trial and error. I added dollars until it worked. Eight works
> > fine too.
> >
> > > Anyway, here is a more short and understandable version of the whole
> > > thing (all functions have one parameter less and only one dollar):
> >
> > Ah! I wasn't aware that a window id could be used in conditions.
> > But you are probably wrong about the number of '$'s because
> > $[w.id] *is* defined initially, but contains the wrong window.
>
> At the time the functions are defined using AddToFunc, $[w.id] is not
> defined. Of course, if you can't guarantee this, it may be escaped
> as $$[w.id], but this is not really needed.
>
> Other than this, since we only use $[w.id] inside ThisWindow condition,
> whenever $[w.id] is defined, it is what we want to use as [De]Schedule
> parameter. So it works well. With other conditions, like All we would
> need many dollars.

Right, but you removed one WindowId command too many.

  Thiswindow ($0) Thiswindow (shaded)

is *not* equvalent to

  ThisWindow ($0, shaded)

It has a different return code which is needed later. New version
that takes care of the bug I described. With any code earlier
than current CVS it immediately crashes because calling Deschedule
from a Schedule command does not work. With my latest patch it is
more stable but may still crash if the timing is wrong.
Basically, fiddling with the scheduler's queue while traversing
through it can cause core dumps. I need to revise the code so
that it delays destroying queue items.

  AddToFunc enter_handler
  + I autohide FvwmButtons 500 S
  # ^ ^ ^
  # | | |___ Shade direction (optional)
  # | |_______ Hide delay
  # |___________________ Unique window name/resource

  AddToFunc autohide
  + I ThisWindow ($0) Deschedule $[w.id]
  + I ThisWindow ($0) ThisWindow (shaded) WindowShade off
  + I Cond (!Match) All ($0, !shaded) autohide_hide $1 $2

  AddToFunc autohide_hide
  + I Schedule $0 $[w.id] WindowShade $1
  + I Schedule $0 $[w.id] Deschedule $[w.id]

  AddToFunc StartFunction
  + I Module FvwmAuto FvwmAutohide -menter enter_handler

Bye

Dominik ^_^ ^_^
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue Apr 15 2003 - 10:14:09 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:54 BST