Subject: Re: Some testing results

From: Dominik Vogt <[email-masked]>
Date: Sun, 3 Mar 2002 19:02:25 +0100

> I wanted to test new contexts, so I tried to "improve" my existing:
> 
>   DestroyFunc ResizeOrRaiseOrShade
>   AddToFunc   ResizeOrRaiseOrShade
>   + H Resize
>   + M Resize
>   + C Raise
>   + D WindowShade
> 
>   Mouse 1  SF  A  ResizeOrRaiseOrShade
> 
> Here is the result:
> 
>   DestroyFunc UnshadeResize
>   AddToFunc   UnshadeResize
>   + I WindowShade off
>   + I Resize
> 
>   DestroyFunc ResizeOrRaiseOrShade
>   AddToFunc   ResizeOrRaiseOrShade
>   + H UnshadeResize
>   + M UnshadeResize
>   + C Raise 
>   + D WindowShade
> 
>   DestroyFunc ResizeOrRaiseOrShade2
>   AddToFunc   ResizeOrRaiseOrShade2
>   + I This (Shaded) CursorMove 0 $[cw.height]p
>   + I ResizeOrRaiseOrShade
> 
>   Mouse 1  SF  A  ResizeOrRaiseOrShade
>   Mouse 1  v_> A  ResizeOrRaiseOrShade2
> 
> Works nicely, this in addition automatically moves cursor when needed.
> BTW, $[cw.height] was buggy before yesterday, but it is correct now.
> 
> ----------------------------------------------------------------------
> 
> Now, something less good. I want to replace UnshadeResize and this does
> not work:
> 
>   DestroyFunc UnshadeResize
>   AddToFunc   UnshadeResize
>   + I This (Shaded) WindowShade off
>   + I Resize
>   + I Cond (Match) WindowShade on 
> 
> Apparently Cond looses the operand window, so when the original window was
> shaded this prompts for a new window.

Hm, I didn't consider the effects, but it worked exactly like
designed.  I thought I had documented it, but obviously I
forgot to do so.  I've made a ptach so that it now works on the
same window as the rest of the function.  But remember that the
original conditional command (e.g. Next) can work on a
*different* window than Cond.

> And if you cancel Resize using mouse 2, this either beeps if the cursor is
> outside of the window on button release, or shades another window with
> cursor, or (if the cursor is inside) the button release acknowledges
> picking a window. All situations do not seem something one would expect.
> But this problem is not relevant here, let first see what happens when
> Resize is not canceled.
> 
> ----------------------------------------------------------------------
> 
> And here are examples when Preserve (or PreserveStatus) would be useful
> (I use my proposed solution about all commands returning status codes):
> 
>   # restore shaded windows after resize
>   DestroyFunc UnshadeResize
>   AddToFunc   UnshadeResize
>   + I This (Shaded) WindowShade off
>   + I PreserveStatus Resize
>   + I On (Success) WindowShade on

You don't need PreserveStatus here.  Only conditional commands
modify the status.

>   # restore cursor at the bottom of window border
>   DestroyFunc ResizeOrRaiseOrShade2
>   AddToFunc   ResizeOrRaiseOrShade2
>   + I This (Shaded) CursorMove 0 $[cw.height]p
>   + I PreserveStatus ResizeOrRaiseOrShade
>   + I On (Success) CursorMove 0 -$[cw.height]p

Same as above.

> The "On (Success)" is only true when This matched.
> 
> Do I understand it right that with the current code (that does not work,
> because operand window is lost), the only way is this function since
> ResizeOrRaiseOrShade by itself contains functions with conditionals:
> 
>   DestroyFunc ResizeOrRaiseOrShade2
>   AddToFunc   ResizeOrRaiseOrShade2
>   + I This (Shaded) CursorMove 0 $[cw.height]p
>   + I CondCase (Match) ResizeOrRaiseOrShade
>   + I CondCase (Error) ResizeOrRaiseOrShade  # for completeness
>   + I CondCase (NoMatch) ResizeOrRaiseOrShade
>   + I Cond (Match) CursorMove 0 -$[cw.height]p  # or CondCase

No.  See above.

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]