GNOME Bugzilla – Bug 631796
GtkWindow: Allow setting size from geometry
Last modified: 2010-10-11 18:17:09 UTC
If you set a geometry widget via gtk_window_set_geometry_hints() it becomes very hard to compute appropriate toplevel sizes in pixels to make the window a particular size. Synthesizing strings and passing them to gtk_window_parse_geometry() is possible, but to avoid avoid such ugliness, add functions: gtk_window_set_default_geometry() gtk_window_resize_to_geometry() That act like gtk_window_set_default_size() and gtk_window_resize() but are in terms of the resize increments of the geometry widget.
Created attachment 172033 [details] [review] GtkWindow: Allow setting size from geometry
Review of attachment 172033 [details] [review]: Sounds ok to me. Geometry widget seems like a pretty fringe case, but why not make terminal authors life a little easier... ::: gtk/gtkwidget.h @@ +897,3 @@ + int old_width, + int old_height); + Ah, thats the header for these functions that I was missing in the other patch.
(In reply to comment #2) > Review of attachment 172033 [details] [review]: > > Sounds ok to me. > Geometry widget seems like a pretty fringe case, but why not make terminal > authors life a little easier... One thing you can do here which might be more generally useful is: gtk_window_set_geometry_widget(window, embedded_drawing_canvas, NULL, 0); [...] gtk_widget_resize_to_geometry(window, 300, 300); Avoiding some pretty bad hacks I've had to do elsewhere to figure out "how big does the window have to be to make widget X 300,300".
Attachment 172033 [details] pushed as a4a7a61 - GtkWindow: Allow setting size from geometry