GNOME Bugzilla – Bug 631903
Report correct minimum/natural sizes for GTK+ 3
Last modified: 2010-10-11 19:36:16 UTC
In GTK+ 3, the hack of reporting the current size of the terminal as its minimum size breaks down because GTK+ 3 will never allocate a widget smaller than its minimum size. However, in GTK+ 3 it's possible to report separate minimum and natural sizes, so we should just report a minimum size of 1x1 character and a natural size of the current size. This requires a change in vteapp.c to make the window start off at the right size.
Created attachment 172114 [details] [review] Report correct minimum/natural sizes for GTK+ 3
+ else { + /* As of GTK+ 2.91.0, the default size of a window comes from its minimum + * size not its natural size, so we need to set the right default size + * explicitly */ + gtk_window_set_default_geometry (window, + vte_terminal_get_column_count (terminal), + vte_terminal_get_row_count (terminal)); + } Does that mean that any gtk3 app embedding a vte app will have its terminal collapse to a 1x1 grid (the minimum size that the new get_preferred_width/height funcs return) without adding code similar to this, or am I misunderstanding this comment?
(In reply to comment #2) > + else { > + /* As of GTK+ 2.91.0, the default size of a window comes from its > minimum > + * size not its natural size, so we need to set the right default size > + * explicitly */ > + gtk_window_set_default_geometry (window, > + vte_terminal_get_column_count (terminal), > + vte_terminal_get_row_count (terminal)); > + } > > Does that mean that any gtk3 app embedding a vte app will have its terminal > collapse to a 1x1 grid (the minimum size that the new > get_preferred_width/height funcs return) without adding code similar to this, > or am I misunderstanding this comment? If they are sizing their toplevel in a simple way like vteapp and not a complex way like gnome-terminal. Without this change, any gtk3 app embedding a gnome-terminal will have the terminal get bigger and bigger and never smaller without regarding the size of the toplevel window. Not better and far more confusing. If GTK+ 3 was changed to select the default toplevel size from the natural size (which probably makes sense) then this code could be removed, which is why I said "As of GTK+ 2.91.0" not "In GTK+ 3". But it will never be wrong code just unnecessary code.
Comment on attachment 172114 [details] [review] Report correct minimum/natural sizes for GTK+ 3 Thanks for the explanation. Please commit to master. (In reply to comment #3) > If GTK+ 3 was changed to select the default toplevel size from the natural size > (which probably makes sense) then this code could be removed Indeed, IMHO that would be better.
(In reply to comment #4) > (From update of attachment 172114 [details] [review]) > Thanks for the explanation. Please commit to master. > > (In reply to comment #3) > > If GTK+ 3 was changed to select the default toplevel size from the natural size > > (which probably makes sense) then this code could be removed > > Indeed, IMHO that would be better. Do you really want to block this on a big discussion of "proper" sizing behavior for GTK+ 3?
No; I marked the patch as 'accepted-commit-now', didn't I :)
Comment on attachment 172114 [details] [review] Report correct minimum/natural sizes for GTK+ 3 Thanks for the review, pushed as 7d0eb2ff21