]> Pileus Git - ~andy/gtk/commit
default impls of width_for_height,hfw should chain directly not use wrapper API
authorHavoc Pennington <hp@pobox.com>
Sun, 5 Sep 2010 05:42:14 +0000 (01:42 -0400)
committerHavoc Pennington <hp@pobox.com>
Mon, 13 Sep 2010 01:47:09 +0000 (21:47 -0400)
commitcf6eb47758085da041fa5fa126d3e22a60bb2afc
tree55bcf2ad9638d354bad0a68be55e36632175b4df
parentb3079c0d18b176bb5e939bf3fefdc2f5852e0a56
default impls of width_for_height,hfw should chain directly not use wrapper API

In GtkBin and GtkWidget we tried to provide handy defaults that
call get_width if there's no get_width_for_height and
get_height for get_height_for_width.

However, they used the wrapper API on GtkSizeRequest instead of
chaining directly to the other method implementation.

This could result in all kinds of surprising behavior, for example,
get_width_for_height() would now already include the effects of set_size_request().

If nothing else it's inefficient. But it's just conceptually wrong,
because to chain to another implementation, we should call the other
implementation, not call a wrapper around the other implementation
(when we're already inside a previous invocation of the wrapper,
i.e. compute_size_for_orientation() ends up reinvoking itself
in the same orientation on the same object which it pretty
likely isn't intending to do)

https://bugzilla.gnome.org/show_bug.cgi?id=628829
gtk/gtkbin.c
gtk/gtkwidget.c