swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Saving window positions


From: Sven N. Thommesen
Subject: Saving window positions
Date: Fri, 01 May 1998 17:16:01 -0500

I've found the following quirk in the way the 'Save' button on the
controlPanel works:

When you hit this button, the current positions of windows are archived in
file .swarmArchiver in your home directory, in delightful Lisp code. Next
time you run that application, the windows will pop up in the position they
held when you last saved. Well, almost always.

Now imagine you have one of those virtual desktops with several
side-by-side areas (let's call them desks), each of size 800x600. I have a
6x2 setup like that. I fired up heatbugs and moved all the windows one desk
to the right, then hit 'Save'. Killed the app, and started it again. 

Surprise! Although the windows had the correct relative placement, they all
appeared on the top left desk, where my xterm window is. Looking at the
Lisp code, I found that all the x-coordinates were < 800, whereas I would
have expected them to be all > 800. Now what?

I seem to recall from when I coded my own widget-placement hack a year back
that getting X to report the absolute position of a window (i.e. relative
to the upper left of the whole virtual desktop) was nigh impossible. What
you get back is the position relative to the desk on which the
application's 'main window' is located, which for Swarm apps is the
controlPanel.

What to do, if you want your app to pop up away from your main working
'desk'? You'd think you could just add a screen width (here, 800) to all x
coordinates, but you'd be surprised! Some windows would be off the screen
... Again the rule is, coordinates are measured relative to where the
controlPanel is at the moment!

Heatbugs comes up in two parts, first the controlPanel and two probe
windows, then the user hits 'Start', then the blt graph and the bug raster
pop up. For the control Panel and windows that pop up at the same time as
it does, x coordinates need to be relative to the desk on which they
originally appear. In this case, we want to move them one desk to the right
so add a screen width to the x coordinates in .swarmArchiver. When the blt
graph and the bug raster come up, however, X windows has 'digested' the
fact that the controlPanel has moved and has reset its 'origin' to the new
desk, so these two windows do not need any x offset. Clear as mud, no?

If there was a way for our intrepid Swarm programmers to get absolute
coordinates saved, we wouldn't have to worry about all this. If they can't,
the above provides a work-around.

Swarmin' on,
Sven Thommesen


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]