The GdkGeometry struct gives the window manager information about a window's geometry constraints.
Class GdkGeometry( [min_width],[min_height],[max_width],[max_height],[base_width],[base_height],[width_inc],[height_inc],[min_aspect],[max_aspect],[win_gravity] )
min_width | minimum width of window (or -1 to use requisition, with GtkWindow only) |
min_height | minimum height of window (or -1 to use requisition, with GtkWindow only) |
max_width | maximum width of window (or -1 to use requisition, with GtkWindow only) |
max_height | maximum height of window (or -1 to use requisition, with GtkWindow only) |
base_width | allowed window widths are base_width + width_inc * N where N is any integer (-1 allowed with GtkWindow) |
base_height | allowed window widths are base_height + height_inc * N where N is any integer (-1 allowed with GtkWindow) |
width_inc | width resize increment |
height_inc | height resize increment |
min_aspect | minimum width/height ratio |
max_aspect | maximum width/height ratio |
win_gravity | window gravity (GdkGravity), see gtk_window_set_gravity() |
Normally you would set these on the GTK+ level using gtk_window_set_geometry_hints(). GtkWindow then sets the hints on the GdkWindow it creates.
gdk_window_set_geometry_hints() expects the hints to be fully valid already and simply passes them to the window manager; in contrast, gtk_window_set_geometry_hints() performs some interpretation. For example, GtkWindow will apply the hints to the geometry widget instead of the toplevel window, if you set a geometry widget. Also, the min_width/min_height/max_width/max_height fields may be set to -1, and GtkWindow will substitute the size request of the window or geometry widget. If the minimum size hint is not provided, GtkWindow will use its requisition as the minimum size. If the minimum size is provided and a geometry widget is set, GtkWindow will take the minimum size as the minimum size of the geometry widget rather than the entire window. The base size is treated similarly.
The canonical use-case for gtk_window_set_geometry_hints() is to get a terminal widget to resize properly. Here, the terminal text area should be the geometry widget; GtkWindow will then automatically set the base size to the size of other widgets in the terminal window, such as the menubar and scrollbar. Then, the width_inc and height_inc fields should be set to the size of one character in the terminal. Finally, the base size should be set to the size of one character. The net effect is that the minimum size of the terminal will have a 1x1 character terminal area, and only terminal sizes on the "character grid" will be allowed.