Subject: FVWM: how to test for Raised but remove the "fully visible" condition

From: David Wu <[email-masked]>
Date: Thu, 15 Jul 2004 11:45:17 -0400

Hi all fvwm gurus

Im trying to implement the following behavior in a function for use in
FvwmTaskBar's Click1 function. But I am having trouble doing so

The following behavior is desired, note that the function will quit
using "Break" as soon as one option is chosen and executed

1. the window will be raised and focused if it is overlapped by any
window (i.e not the top most window)
2. the window will be raised and focused if it is not currently focused,
even if it is the top most window
3. the window will be minimized if it is already the top most window and
its focused
4. the window will be deiconified and raised and focused if it is
currently in a iconified state

here is what i have right now 

DestroyFunc Raise-or-Iconify
AddToFunc Raise-or-Iconify
+ I ThisWindow (Iconic) Deiconify-and-Raise
+ I TestRc (Match) Break
+ I ThisWindow (!Raised) Focus-and-Raise
+ I TestRc (Match) Break
+ I ThisWindow (!Focused) Focus-and-Raise
+ I TestRc (Match) Break
+ I Iconify

The problem I Have is the line 
+ I ThisWindow (!Raised) Focus-and-Raise
Because testing for Raised condition also require the window to be
"fully visible within the view port". Therefore a window which is on the
very top but part of it not in the current viewport will cause it to
return "not raised" even though the window is on the very top (causing
option 1 to be executed when option 3 is desired). Is there a way to
simply test if a window is on the very top without the "fully visible
condition"? Any workaround is appreciated 

Thank you in advance

DavidHi all fvwm gurus

Im trying to implement the following behavior in a function for use in
FvwmTaskBar's Click1 function. But I am having trouble doing so

The following behavior is desired, note that the function will quit
using "Break" as soon as one option is chosen and executed

1. the window will be raised and focused if it is overlapped by any
window (i.e not the top most window)
2. the window will be raised and focused if it is not currently focused,
even if it is the top most window
3. the window will be minimized if it is already the top most window and
its focused
4. the window will be deiconified and raised and focused if it is
currently in a iconified state

here is what i have right now 

DestroyFunc Raise-or-Iconify
AddToFunc Raise-or-Iconify
+ I ThisWindow (Iconic) Deiconify-and-Raise
+ I TestRc (Match) Break
+ I ThisWindow (!Raised) Focus-and-Raise
+ I TestRc (Match) Break
+ I ThisWindow (!Focused) Focus-and-Raise
+ I TestRc (Match) Break
+ I Iconify

The problem I Have is the line 
+ I ThisWindow (!Raised) Focus-and-Raise
Because testing for Raised condition also require the window to be
"fully visible within the view port". Therefore a window which is on the
very top but part of it not in the current viewport will cause it to
return "not raised" even though the window is on the very top (causing
option 1 to be executed when option 3 is desired). Is there a way to
simply test if a window is on the very top without the "fully visible
condition"? Any workaround is appreciated 

Thank you in advance

David

--
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: Dominik Vogt <[email-masked]>
Date: Fri, 16 Jul 2004 12:44:26 +0200

> condition"? Any workaround is appreciated 

Try the new condition "Overlapped" I just committed to CVS.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 16 Jul 2004 12:12:40 +0200

On Thu, Jul 15, 2004 at 11:45:17AM -0400, David Wu wrote:
> option 1 to be executed when option 3 is desired).

> Is there a way to

There is no such test, and If I knew about a workaround I'd have
coded it into fvwm long ago.  Let me explain:

The user would expect that "Raised" means "not below any other
window".  If windows overlap, it is clear which window is raised,
but what if they don't overlap?  Then it is reasonable to assume
that both windows a raised, but in fact only one of them is.  The
X server still keeps them ordered in case they overlap in the
future.  But then, your function would have a random result from
the user's point of view.

So I chose to code the current logic.  X has an event that tells
fvwm whether a window is obscured by something or not, and this
information is used by the Raised condition.  Unfortunately,
windows are always obscured if they are not completely on screen,
making this whole logic useless.

Even if I added a way to query the window on top of the stack, you
would not be happy with the result.

Ciao

Dominik ^_^  ^_^

---

From: David Wu <[email-masked]>
Date: Fri, 16 Jul 2004 19:29:37 -0400

Wow, that worked wonders!!! thanks so much again Dominik :)
looks like you found a solution !

Thanks so much you are extreme :)

David