Subject: FVWM: Helper Function to chnages Layers.

From: Thomas Glanzmann <[email-masked]>
Date: Fri, 27 Dec 2002 00:19:40 +0100

Hi FVWMers,
I have currently the following HotKey (Ctrl + Alt + S) to get the window with
the current focus into Layer 4 (the fvwm default, I think).

Key	S	W	CM	RaiseOnTop

DestroyFunc RaiseOnTop
AddToFunc RaiseOnTop
	+ I Layer 0 4
	+ I Raise 

I am looking for a helper function that moves the window with the current focus
into layer 4 and if it is already in layer 4 it should move the window to layer
10.

Any solutions?

As you might already know please reply also per eMail to me because I am
currently not subscribed to the list.

Greetings,
	Thomas
--
Thomas Glanzmann  ++49 (0) 9131 85-27574   Department of Computer Science III
Martensstrasse 3  D-91058 Erlangen Germany   University of Erlangen-Nuremberg
	    http://www3.informatik.uni-erlangen.de/Research/UMLinux/
--
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, 27 Dec 2002 00:56:09 +0000

On 27 Dec 2002 00:19:40 +0100, Thomas Glanzmann wrote:
> 
> I have currently the following HotKey (Ctrl + Alt + S) to get the window
> with the current focus into Layer 4 (the fvwm default, I think).
> 
> Key	S	W	CM	RaiseOnTop
> 
> DestroyFunc RaiseOnTop
> AddToFunc RaiseOnTop
> 	+ I Layer 0 4
> 	+ I Raise 
> 
> I am looking for a helper function that moves the window with the
> current focus into layer 4 and if it is already in layer 4 it should
> move the window to layer 10.

There is a Layer condition to do what you want:

  ThisWindow (Layer 4) Layer 10

Just keep in mind that if you want if-else construct you should use either
new 2.5.x Cond command or first conditionally construct a function and
only then execute it, like:

  # cyclicly change a window layer 4 -> 10 -> 5 -> 9 -> 4

  DestroyFunc ActuallyDoLayer
  AddToFunc   ActuallyDoLayer
  ThisWindow (Layer  4) + Layer 10
  ThisWindow (Layer  5) + Layer  9
  ThisWindow (Layer  9) + Layer  4
  ThisWindow (Layer 10) + Layer  5
  ActuallyDoLayer

P.S. Layer command does not work in 2.5.5 and in cvs for now.

Regards,
Mikhael.

---

From: Thomas Glanzmann <[email-masked]>
Date: Fri, 27 Dec 2002 02:43:23 +0100

> P.S. Layer command does not work in 2.5.5 and in cvs for now.

Thanks for the fast answer. It's the right direction but does not solve my
specific problem.

I need the following:

	If (Layer == 4) {
		put on Layer 10;
	} else {
		put on Layer 4;
	}

I tried the following, but it is crap anyway:

DestroyFunc RaiseOnTop
AddToFunc RaiseOnTop
	+ I Raise 
	+ ThisWindow (Layer 4)  Layer 10
	+ ThisWindow (!Layer 4) Layer 4

Because if it done I am back in Layer 4. So I see at the moment no way to solve
this problem. Do you habe any idea?

Greetings and thank you again for your fast response, 

	Thomas (who is still _not_ on the list ... so please reply by email,
		too)
		~~~

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 27 Dec 2002 06:00:57 +0000

On 27 Dec 2002 02:43:23 +0100, Thomas Glanzmann wrote:
> Because if it done I am back in Layer 4. So I see at the moment no way
> to solve this problem. Do you habe any idea?

I knew you will need an if-else construct, so I solved it for you in
my original message, please reread it again (it is also quoted above).
I will copy it again:

  DestroyFunc RaiseOnTop
  AddToFunc   RaiseOnTop
  + I Raise
  + I DestroyFunc ActuallyDoLayer
  + I AddToFunc   ActuallyDoLayer
  + I ThisWindow (Layer  4) + Layer 10
  + I ThisWindow (Layer 10) + Layer  4
  + I ActuallyDoLayer

Note, I don't know how this is useful, just does what you ask, in 2.4.x.

Regards,
Mikhael.

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 27 Dec 2002 06:10:31 +0000

>   + I ThisWindow (Layer 10) + Layer  4

Well, it should be of course "+ I" and not "+" in the Layer lines.

  + I ThisWindow (Layer  4) + I Layer 10
  + I ThisWindow (Layer 10) + I Layer  4

Regards,
Mikhael.

---

From: Thomas Glanzmann <[email-masked]>
Date: Fri, 27 Dec 2002 14:14:56 +0100

> Note, I don't know how this is useful, just does what you ask, in 2.4.x.
It is useful to get some applications on the fly on top of everything else and
back down.

Okay, I got the point. Thanks for your patience. Now it works to get Layer 4
into Layer 10 and Layer 10 into Layer 4. But it still does not get Layer !4 into
Layer 4.

I tried the following:

	   + I ThisWindow (Layer  4) + I Layer 10
	   + I ThisWindow (!Layer 4) + I Layer  4

Result: Window stays always on Layer 4 and get's lowered !?

And
	   + I ThisWindow (Layer  4) + I Layer 10
	   + I Not (Layer 4) + I Layer  4

Result: Window get's into layer 10 and stays there.

So, what can I do? Anyway what is broken with the fvwm current layer stuff, that
I could not use it?

Greetings,
	Thomas

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 27 Dec 2002 13:46:10 +0000

On 27 Dec 2002 14:14:56 +0100, Thomas Glanzmann wrote:
> 
> So, what can I do? Anyway what is broken with the fvwm current layer
> stuff, that I could not use it?

Try "Layer 0 10" in FvwmConsole, you'll see it does not do anything.

You may downgrade to 2.4.14 or 2.5.4 or wait until Layer command is fixed,
then use a daily snapshot.

Regards,
Mikhael.