Subject: FVWM: Windows opening partially off screen

From: "Moore, Garron" <[email-masked]>
Date: Mon, 9 Aug 2004 08:15:01 -0700

Some of the windows in our app are set up to open with their top left corner where the mouse pointer is. If the mouse pointer is next to the right or bottom of the screen, the windows are opening up partially off the screen. Is there a Style that can be set to ensure the windows will be placed completely on the screen?

Thanks,
Garron Moore
--
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: "Moore, Garron" <[email-masked]>
Date: Thu, 12 Aug 2004 11:29:04 -0700

FvwmEvent is a good suggestion. I have figured out how to create functions
to move a window to the screen edge, but is there a way to check where the
window is and run the appropriate command based on its location? 

I have figured out some functions, but I don't know how to implement
MoveWindowOnScreen. Can someone give me advice?

Module FvwmEvent

*FVWMEvent: PassID
*FVWMEvent: add_window MoveWindowOnScreen

AddToFunc MoveToTop
+ I Move keep 0

AddToFunc MoveToBottom
+ I Move keep -0

AddToFunc MoveToLeft
+ I Move 0 keep

AddToFunc MoveToRight
+ I Move -0 keep

AddToFunc MoveWindowOnScreen
# if window is off to left
#	MoveToLeft
# if window is off to right
#	MoveToRight
# if window is off to top
#	MoveToTop
# if window is off to bottom
#	MoveToBottom

Thanks,
Garron Moore

On Wed, Aug 11, 2004 at 04:12:08PM -0700, Moore, Garron wrote:

(Please type replies below the quoted sections of the precvious mail on this list).

> Does anyone have any ideas? I feel like I have tried everything.

I can't think of anything short of using FvwmEvent to execute a script that corrects 
the window position if it's off screen.

> Also, moving windows works just fine. They won't move off of the 
> Screen. If I move a window that is partially off the screen, it will 
> jump to be completely on the screen.

[snip]

> > Some of the windows in our app are set up to open with their top 
> > left corner where the mouse pointer is. If the mouse pointer is next 
> > to the right or bottom of the screen, the windows are opening up 
> > partially off the screen. Is there a Style that can be set to ensure 
> > the windows will be placed completely on the screen?

If you have control over what the application does, why don't you modify the 
application code.  Okay, it does not know the size of the decorations beforehand, 
but it could at least make sure that the window stays almost on screen.

Ciao

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" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: "Moore, Garron" <[email-masked]>
Date: Thu, 12 Aug 2004 12:42:59 -0700

I think that it would be something like this, but the expressions don't
evaluate and I'm not sure that this is proper syntax.

AddToFunc MoveWindowOnScreen
+ I WindowId $0 ($[w.x] < 0) MoveToLeft
+ I WindowId $0 (($[w.x] + $[w.width]) > $[vp.width]) MoveToRight
+ I WindowId $0 ($[w.y] < 0) MoveToTop
+ I WindowId $0 (($[w.y] + $[w.height]) > $[vp.height]) MoveToBottom

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

Module FvwmEvent

*FVWMEvent: PassID

AddToFunc MoveToTop
+ I Move keep 0

AddToFunc MoveToBottom
+ I Move keep -0

AddToFunc MoveToLeft
+ I Move 0 keep

AddToFunc MoveToRight
+ I Move -0 keep

Thanks,
Garron Moore

[snip]

Ciao

Dominik ^_^  ^_^

---

From: "Moore, Garron" <[email-masked]>
Date: Wed, 18 Aug 2004 09:26:17 -0700

For anyone who is interested, I found something that works and have
included it below.

Garron

Module FvwmEvent
*FVWMEvent: PassID

AddToFunc MoveWindowOnScreen
+ I PipeRead "if [ `expr $[w.x] + $[w.width] - $[vp.width]` -gt 0 ]; then echo MoveToRight; fi"
+ I PipeRead "if [ $[w.y] -lt 0 ]; then echo MoveToLeft; fi"
+ I PipeRead "if [ `expr $[w.y] + $[w.height] - $[vp.height]` -gt 0 ]; then echo MoveToBottom; fi"
+ I PipeRead "if [ $[w.x] -lt 0 ]; then echo MoveToTop; fi"

AddToFunc MoveToTop
+ I Move keep 0
AddToFunc MoveToBottom
+ I Move keep -0
AddToFunc MoveToLeft
+ I Move 0 keep
AddToFunc MoveToRight
+ I Move -0 keep

-----Original Message-----
From: Moore, Garron 
Sent: Thursday, August 12, 2004 12:43 PM
To: Moore, Garron; [email-masked]; fvwm
Subject: RE: FVWM: Windows opening partially off screen

Module FvwmEvent

*FVWMEvent: PassID

AddToFunc MoveToTop
+ I Move keep 0

AddToFunc MoveToBottom
+ I Move keep -0

AddToFunc MoveToLeft
+ I Move 0 keep

AddToFunc MoveToRight
+ I Move -0 keep

Thanks,
Garron Moore

[snip]

Ciao

Dominik ^_^  ^_^