Subject: FVWM: Hide comand again

From: Marcus Lundblad <[email-masked]>
Date: Fri, 8 Mar 2002 01:52:43 +0100 (CET)

I implemented the Hide command like this:

AddToFunc
+				"I" MoveToDesk 0 12356

Though, if I run this on a sticky window, it stays sticky.
In the documentation it says on "MoveToPage" that it turns off sticky if
it's on, but it doesn't say so for MoveToDesk (and it apparently doesn't).
Is this intentional?

//Marcus

--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 8 Mar 2002 22:54:27 +0000

> it's on, but it doesn't say so for MoveToDesk (and it apparently doesn't).

I don't think MoveToDesk should unstick a window. MoveToPage does unstick.

Ok, here is my implementation of your hide and unhide functions:

  DestroyFunc HideWindow
  AddToFunc   HideWindow
  + I Pick                # enable interactive execution of HideWindow
# + I Cond (Error) Break  # this syntax is valid in 2.5.x, may be changed
  + I AddToFunc   RestoreStickinessOf$w
  + I WindowId $w (Sticky) + I Stick on
  + I WindowId $w (Sticky) Stick off
# + I + I Break           # you may add this line in 2.5.x
  + I MoveToDesk 0 123

  DestroyFunc UnhideWindow
  AddToFunc   UnhideWindow
  + I AddToFunc   RestoreStickinessOf$w
  + I Function RestoreStickinessOf$w
  + I DestroyFunc RestoreStickinessOf$w
  + I MoveToDesk

If you use 2.4.x, don't include commented out lines, they are not needed.
It is possible to simplify these functions a bit if don't want to handle
situations like two "hide" or two "unhide" on the same window. Usage:

  All ("XClock") HideWindow
  All ("XClock") UnhideWindow

Regards,
Mikhael.