Subject: FVWM: Tricky placement of a Java program

From: Andrei Popov <[email-masked]>
Date: Fri, 3 Jun 2005 14:37:05 +0300

Hello All.

I have a problem with a java program that won't listen to reason. And
by reason I mean the position on screen.

I'm using gtk2 apps almost exclusively, and they somehow store their
position after you run them for second time. E.g. if you run gedit for
the first time, maximize its window and then close it, next time you
run gedit it will start exactly where you left it.

Also most gtk2 apps recognize EWMH hints and don't overlap my
gnome-panel at the top.

I have a useful Java program that:

1. starts where it wants every time
2. doesn't know about the -geometry argument or anything similar
3. doesn't give a damn about ewmh (or so it seems)
4. contains two windows, which need to be placed like this:
________________________________________
|                         |             |
|                         |             |
|                         |             |
|                         |             |
|                         |             |
|                         |             |
|                         |             |
|_________________________|_____________|

... i.e. the first window occupies some 2/3 and the second about 1/3
of the screen to the right. Windows are side by side. Ideally my
self-made FvwmToolbar at the bottom (45 pixels) and the gnome-panel at
the top (24 pixels) should not be overlapped either.

THE QUESTION: How do I achieve such a placement automatically, each
time I start this Java app?

I guess I need to use FvwmEvent to trigger a neat function that will
do the trick.

Any help and pointers in the right direction are appreciated!

-- 
WBR,
Andrei Popov

Using FVWM 2.5.12

--
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: Thomas Adam <[email-masked]>
Date: Fri, 3 Jun 2005 15:19:48 +0100

> run gedit it will start exactly where you left it.

That's all thanks to PPosition.

> I guess I need to use FvwmEvent to trigger a neat function that will

I've mentioned how to do this several times over at the fvwm-forms.
It's also an entry in the FAQ.  Essentiall you want something like this:

DestroyModuleConfig FvwmEvent-Java: *
*FvwmEvent-Java: Cmd Function
*FvwmEvent-Java: add_window SomeFunc

DestroyFunc SomeFunc
AddToFunc SomeFunc
+ I ThisWindow ("some_name") Move 200 +90

AddToFunc StartFunction Module FvwmEvent FvwmEvent-Java

You'll want to play about with the 'SomeFunc' definition, but that
should get you started.

-- Thomas Adam

--  
"One of us is a cigar stand, and one of us is a lovely blue incandescent
guillotine" -- Stephen Malkmus, "Type Slowly" from "Brighten The Corners"
--
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].