[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fvwm
Subject:    Re: FVWM: SnapGrid for icons only?
From:       Stephen Talley <stephen.talley () sun ! com>
Date:       2009-02-15 19:03:27
Message-ID: 20090215190327.GA2373 () dabulls ! central ! sun ! com
[Download RAW message or body]


Thomas Adam wrote:

> > Upon upgrading, I see that SnapGrid is now a style, so I changed
> > this to:
> >
> >    Style * SnapGrid 0 0
> >
> >    DestroyFunc MoveIcon
> >    AddToFunc MoveIcon
> >    + I Style * SnapGrid $[ICONWIDTH] $[ICONHEIGHT]
> >    + I Move
> >    + I Style * SnapGrid 0 0
> >
> > But this no longer works -- the "SnapGrid 0 0" behavior is always
> > in effect.  It appears the Style commands don't take effect until
> > after the Move.
> >
> > Is there some way to force the Style changes before the Move?
>
> You would need to enforce that via PipeRead to ensure correct
> synchronisation of commands.
>
> Of course, given this already has an operand window at the time it's
> run, I fail to see why you're making it a global thing.  C.f.:
>
> DestroyFunc MoveIcon
> AddToFunc MoveIcon
> + I WindowStyle SnapGrid $[ICONWIDTH] $[ICONHEIGHT]
> + I UpdateStyles
> + I PipeRead `echo Move`
> + I WindowStyle SnapGrid 0 0
> + I UpdateStyles
>
> Note the PipeRead which ensures nothing else after it in the
> function runs until it completes (i.e., PipeRead always blocks
> events.)  I've not tested this, but something similar to the above
> ought to put you on the right lines.  I don't use Icons in my setup.

Thanks Thomas, this works as advertised.  I had overlooked the new
WindowStyle command, as well as the UpdateStyles command in the man
page.

Incidentally, it appears that vanilla Move (sans PipeRead)
sufficiently blocks the style reset until the move completes.

Thanks again,

Steve

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic