On 05.09.14 18:28, Dominik Vogt wrote:
> On Fri, Sep 05, 2014 at 02:03:16PM +0300, Nikos Leonardos wrote:
> > Thank you Thomas for the quick response.
> >
> > On 05.09.14 11:53, Thomas Adam wrote:
> > > On Fri, Sep 05, 2014 at 12:37:41PM +0300, Nikos Leonardos wrote:
> > > It will do, because those won't be applied necessarily in the order you
> > > think they will. What I would do is to use State instead to achieve this.
> >
> > Could you explain why they are not applied in this order? In
> > particular, why should they be applied in order for your
> > ApplyWindow function below, but not for my FuncToggleTitle
> > function above?
>
> Fvwm is lazy about applying styles to windows to reduce the number
> of useless updates. For example, if you read in a file that
> defines twenty new styles, you wouldn't want the windows to be
> updated twenty times. So, fvwm waits until no more commands are
> coming in and then updates all windows that need updates at the
> same time.
Thank you Diminik for the explanation. I understand now.
> The one situation where this is confusing is in complex functions.
> Styles will only be applied when the outermost function has
> completed. In your case, use the UpdateStyles command to apply
> style updates immediately. From the man page:
>
> > To force that all pending changes are applied immediately, use
> > the UpdateStyles, Refresh or RefreshWindow commands.
DestroyWindowStyle in the beginning and UpdateStyles before
maximizing did the trick for me! I ended up with the
following:
DestroyFunc ToggleTitleMaximize
AddToFunc ToggleTitleMaximize
+ I DestroyWindowStyle
+ I PipeRead \
'if xprop -id $[w.id]|grep WM_FRAME|grep -q 19; \
then echo "WindowStyle !Title"; \
else echo "WindowStyle Title"; fi'
+ I UpdateStyles
+ I Maximize True 0 100
Thomas and Dominik, thank you.
--Nikos
> (I'm not sure that the refresh commands would really do that.)
>
> Ciao
>
> Dominik ^_^ ^_^
>
> --
>
> Dominik Vogt
>