gEDA-dev: GschemDialog (work in progress)

Peter Clifton pcjc2 at cam.ac.uk
Wed May 9 20:27:46 EDT 2007


On Thu, 2007-05-10 at 00:20 +0200, Ivan Stankovic wrote:
> On Wed, May 09, 2007 at 02:47:37PM +0100, Peter Clifton wrote:

> > Lets assume for a minute we might want to make saving of position and
> > size configurable - perhaps independently, often I want to remember size
> > but don't care about position.
> > 
> > Should we do this per dialog (fiddly?), or as a global option? At what
> > point should we over-ride the code? Should we save, but choose not to
> > use the information?
> 
> I think this would only add needless complexity. I may be wrong, but how
> many people would actually use this? If you don't care about position,
> you just don't move the dialog. I am a big fan of the KISS principle;
> generally speaking, simpler code means code that is faster, easier
> to maintain and debug.

I sometimes work with dual monitor systems, and wonder if the position
(with Xinerama, say), should be relative to the screen the gschem window
is on, not absolute coordinates. I've not got a dual screen setup at the
moment to try on at the moment. Having never coded anything explicitly
for Xinerama, I'm not sure what API is necessary.

gdk_screen_get_monitor_at_window and gdk_screen_get_monitor_geometry
look useful.

> > Perhaps (but I've not had time to test), the window manager will pay
> > more attention to a gtk_window_move() before the window is mapped if we
> > set some geometry hints with gtk_window_set_geometry_hints():
> > 
> > GDK_HINT_POS indicates that the program has positioned the window
> > 
> > and perhaps (although I'm not sure we can "morally" claim this):
> > 
> > GDK_HINT_USER_POS indicates that the window's position was explicitly
> > set by the user.
> 
> >From http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#GdkWindowHints:
> 
> "GDK_HINT_USER_POS will be set automatically by GtkWindow if you call
> gtk_window_move()"
> 
> So I guess that's alright.

Ok, I didn't spot that. I don't think my window-manager is honouring the
first move operation (before the window is mapped), as it "knows best"
where to put the window. We could tell lies and set GDK_HINT_USER_POS.
Its not like we're making the numbers up, they are saved positions from
the user's last session.

http://developer.gnome.org/doc/API/2.0/gtk/GtkWindow.html#gtk-window-move

"most window managers ignore requests for initial window positions
(instead using a user-defined placement algorithm) and honor requests
after the window has already been shown."

Sounds really "useful" - we can move the window, but only after its
already been redrawn once.


Regards,

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



More information about the geda-dev mailing list