Subject: Notification: incoming/859

From: [email-masked]
Date: Fri, 01 Mar 2002 17:56:35 -0600

FVWM Bug Tracking notification

new message incoming/859

Message summary for PR#859
	From: [email-masked]
	Subject: suggestion: ResizeUnshades option
	Date: Fri, 01 Mar 2002 17:56:34 -0600
	0 replies 	0 followups

====> ORIGINAL MESSAGE FOLLOWS <====

>From [email-masked] Fri Mar 01 17:56:35 2002
From: [email-masked]
To: [email-masked]
Subject: suggestion: ResizeUnshades option
Date: Fri, 01 Mar 2002 17:56:34 -0600

Full_Name: Neil Zanella
Version: 2.4.5
CVS_Date: 
OS: Linux 2.4.7
X_Server: XFree86 4.1.0
Submission from: (NULL) (129.128.206.232)

It would be nice if there were a configuration option called
ResizeUnshades.
What this option would oo is the following: if a window is resized when
it is shaded then it would become unshaded.

Thanks,

Neil

--
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: Sat, 2 Mar 2002 08:37:25 +0100

> it is shaded then it would become unshaded.

It's easy to do without a new option:

  AddToFunc ResizeUnshade
  + I WindowShade off
  + I Resize

You may want to disable the shading animation first.

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]

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 2 Mar 2002 23:13:18 +0000

> You may want to disable the shading animation first.

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.

Please run this code, so you may understand what I am speaking about.

----------------------------------------------------------------------

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.

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

  # 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

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

Regards,
Mikhael.