Blame docs/sizing-test.txt

Packit 98cdb6
This is a list of things to check when testing window size/pos functions.
Packit 98cdb6
===
Packit 98cdb6
Packit 98cdb6
gtk_widget_set_size_request():
Packit 98cdb6
 - causes the widget to request the given size
Packit 98cdb6
 - for toplevel windows, changes the default-requested size if 
Packit 98cdb6
   no default size is set and gtk_window_resize() has not been called
Packit 98cdb6
 - passing -1 for either width or height reverts to "natural" request
Packit 98cdb6
   in that dimension
Packit 98cdb6
 - passing 0 is allowed, and results in requisition of 1x1 
Packit 98cdb6
   (0x0 is a permitted requisition, but equivalent to 1x1, 
Packit 98cdb6
   we use 1x1 for implementation convenience)
Packit 98cdb6
 - causes notifies on width_request, height_request properties
Packit 98cdb6
Packit 98cdb6
gtk_window_resize():
Packit 98cdb6
 - causes a configure request in all cases if the window is mapped, 
Packit 98cdb6
   unless the new size is the same as the old size
Packit 98cdb6
 - overrides the default size on map if the window is unmapped
Packit 98cdb6
 - allows size of 0, equivalent to 1
Packit 98cdb6
 - clamped to geometry hints
Packit 98cdb6
Packit 98cdb6
gtk_window_set_default_size():
Packit 98cdb6
 - has no effect after the window has been mapped the first time, 
Packit 98cdb6
   unless the window has been unrealized in which case it should 
Packit 98cdb6
   have an effect
Packit 98cdb6
 - allows size of 0, equivalent to 1
Packit 98cdb6
 - allows size of -1 to unset the default size
Packit 98cdb6
 - clamped to geometry hints
Packit 98cdb6
 - gtk_window_resize() overrides it
Packit 98cdb6
 - causes notifies on default_width, default_height properties
Packit 98cdb6
Packit 98cdb6
gtk_window_get_default_size():
Packit 98cdb6
 - returns the values last passed to set_default_size(), including 
Packit 98cdb6
   -1. If set_default_size() has not been called, returns -1.
Packit 98cdb6
Packit 98cdb6
gtk_window_move():
Packit 98cdb6
 - always causes a configure request if the window is mapped, 
Packit 98cdb6
   unless the last configure request we sent was for the same
Packit 98cdb6
   position being moved to
Packit 98cdb6
 - position may be negative to move windows offscreen
Packit 98cdb6
 - if GTK_WIN_POS_CENTER_ALWAYS (or other future position 
Packit 98cdb6
   constraints we may add) is in effect, the move
Packit 98cdb6
   request is clamped to obey the constraints. thus
Packit 98cdb6
   calling gtk_window_move() on a CENTER_ALWAYS window 
Packit 98cdb6
   may trigger the window to bounce back to center if it 
Packit 98cdb6
   wasn't there
Packit 98cdb6
 - overrides all GTK_WIN_POS_ except CENTER_ALWAYS
Packit 98cdb6
Packit 98cdb6
gtk_window_get_size():
Packit 98cdb6
 - obtains the client-side known size of widget->window, 
Packit 98cdb6
   as last received from a configure event
Packit 98cdb6
 - prior to mapping, returns the default size we will request
Packit 98cdb6
 - between realization and mapping, computes default size 
Packit 98cdb6
   rather than looking at widget->window up-to-date size, 
Packit 98cdb6
   so the size will be correct after force-realizing a window
Packit 98cdb6
Packit 98cdb6
gtk_window_get_position():
Packit 98cdb6
 - obtains the point to be passed to gtk_window_move() in order
Packit 98cdb6
   to keep the window in its current position
Packit 98cdb6
 - round-trips to the server to get the position; this is suboptimal
Packit 98cdb6
   from both a race condition and speed standpoint but required to get
Packit 98cdb6
   window frame size
Packit 98cdb6
 - if the window is unmapped, returns the default position we will 
Packit 98cdb6
   request
Packit 98cdb6
Packit 98cdb6
gtk_window_set_position():
Packit 98cdb6
 - not the inverse of get_position(), sadly
Packit 98cdb6
 - modifies the default positioning of the window
Packit 98cdb6
 - if set to CENTER_ALWAYS and the window is mapped, results in a
Packit 98cdb6
   configure request moving the window to the center, unless the 
Packit 98cdb6
   window was already centered
Packit 98cdb6
 - ignored if gtk_window_move() called, with the exception 
Packit 98cdb6
   of CENTER_ALWAYS
Packit 98cdb6
Packit 98cdb6
gtk_window_parse_geometry():
Packit 98cdb6
 - parses a standard X geometry string
Packit 98cdb6
 - toggles on one or both of GDK_HINT_USER_SIZE, GDK_HINT_USER_POS
Packit 98cdb6
 - "xprop" shows user size/position are set on the window
Packit 98cdb6
 - calls gtk_window_set_default_size() to set the window size
Packit 98cdb6
 - calls gtk_window_move() to set the window position
Packit 98cdb6
 - calls gtk_window_set_gravity() to set the window gravity
Packit 98cdb6
Packit 98cdb6
gtk_window_reshow_with_initial_size():
Packit 98cdb6
 - for use by GUI builders; unrealizes and re-shows the window, 
Packit 98cdb6
   using default size (and also position, but position 
Packit 98cdb6
   is reset on any hide anyway)
Packit 98cdb6
 - window should be positioned and sized as it was on initial map,
Packit 98cdb6
   barring odd window managers
Packit 98cdb6
Packit 98cdb6
gtk_window_set_geometry_hints():
Packit 98cdb6
 - if a hint is set with this function, we do not override it
Packit 98cdb6
   in other parts of the code
Packit 98cdb6
Packit 98cdb6
General behavior
Packit 98cdb6
===
Packit 98cdb6
Packit 98cdb6
 - no infinite loops or nasty fighting-the-user flicker during 
Packit 98cdb6
   operations such as moving/resizing a window
Packit 98cdb6
Packit 98cdb6
Properties
Packit 98cdb6
===
Packit 98cdb6
Packit 98cdb6
GtkWindow::default_width, GtkWindow::default_height:
Packit 98cdb6
 - default_width is -1 if unset, or >= 0 if 
Packit 98cdb6
   a default width is set
Packit 98cdb6
 - default_height is -1 if unset, or >= 0 if
Packit 98cdb6
   a default height is set
Packit 98cdb6
Packit 98cdb6
GtkWindow::allow_grow, GtkWindow::resizable:
Packit 98cdb6
 - equivalent properties; changing one notifies on the other
Packit 98cdb6
 - if FALSE, we set the min size to the max size in the geometry 
Packit 98cdb6
   hints. 
Packit 98cdb6
 - If the app programmer has called gtk_window_set_geometry_hints()
Packit 98cdb6
   however and set min or max size, we don't replace the hint they
Packit 98cdb6
   set.
Packit 98cdb6
Packit 98cdb6
GtkWidget::width_request, GtkWidget::height_request:
Packit 98cdb6
 - if -1, default requisition of widget is used
Packit 98cdb6
 - otherwise, override default requisition
Packit 98cdb6
Packit 98cdb6