Re: geometry specification in Apps.





 Owen Taylor twisted the bytes to say:

 Owen> "Daniel M. German" <dmg@csg.uwaterloo.ca> writes:

 >> 
 >> gtk_widget_set_uposition (GTK_WIDGET (retval->main_window), xpos, ypos);
 >> 
 >> 
 >> does not take into account the size of the window if the parameters
 >> are negative. For instance, try 
 >> 
 >> gnome-terminal --geometry 40x30-0+0
 >> 
 >> You will see that instead of locating the window in the upper right
 >> corner, you will see it (or not :) out of the screen.

 Owen> I wouldn't expect gtk_widget_set_uposition() to do the funky X
 Owen> geometry stuff. In fact, since it takes integers, it _couldn't_
 Owen> distinguish -0. 


Sorry, I should had been a little more specific. As Michael pointed
out, the problem is gnome_parse_geometry. It properly scans the "-"
computes the proper values (with respect to the size of screen) but
the return values have no indication that they refer to the upper or
lower bound of monitor. I ripped gnome_parse_geometry from gnome-libs
and created a variation:

ggv_parse_geometry (const gchar *geometry, 
                    gint *xpos, gint *ypos, 
		    gboolean *xneg, gboolean *yneg,
                    gint *width, 
                    gint *height)

xneg and yneg are true if the coordinates are "negative".

Is anybody else interested in this behaviour?

Also, how do I compute the size of the titlebar as created by the
windows manager so I can properly located the window when the vertical
location is relative to the lower edge of the screen?

I don't know too much about X so I have no idea what exactly the
gravity is, can somebody point me to the proper location for more
information? I _like_ this behaviour in general, and I am willing to
hack to have it across GNOME applications (I believe it is feature
that it is too important not to have). I just need a little bit of
direction on what to do.

Thanks!

 Owen> However, that if you set a position of -1 for
 Owen> gtk_widget_set_uposition(), it will unset the position entirely is a
 Owen> misfeature of the API.

 Owen> That there isn't a way of setting the gravity hint on a GTK window is
 Owen> a missing feature. You need this to properly do the X style -0 stuff.

 Owen> Regards,
                                        Owen


--
Daniel M. German                  "No one can be a great thinker
                                   who does not recognize,
                                   that as a thinker it is his
                                   first duty to follow
                                   his intellect to whatever
   John Stuart Mill ->             conclusions it may lead."
http://csgwww.uwaterloo.ca/~dmg/home.html
dmg@csg.uwaterloo.ca

 



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