Fixed height-for-width cache

Fixed the cache to be cleared when flagged with WIDTH/HEIGHT_REQUEST_NEEDED.
This error was causing some widgets to not be sized correctly (the stock and
icon browser in the demo for instance).
This commit is contained in:
Tristan Van Berkom 2010-04-19 20:41:23 -04:00
parent 119267d7c8
commit ee8db39393

View File

@ -129,6 +129,7 @@ get_cache (GtkExtendedLayout *layout, gboolean create)
return cache;
}
static void
do_size_request (GtkWidget *widget)
{
@ -166,6 +167,8 @@ compute_size_for_orientation (GtkExtendedLayout *layout,
if (GTK_WIDGET_WIDTH_REQUEST_NEEDED (layout) == FALSE)
found_in_cache = get_cached_desired_size (for_size, cache->desired_widths, &cached_size);
else
memset (cache->desired_widths, 0x0, N_CACHED_SIZES * sizeof (DesiredSize));
}
else
{
@ -173,6 +176,8 @@ compute_size_for_orientation (GtkExtendedLayout *layout,
if (GTK_WIDGET_WIDTH_REQUEST_NEEDED (layout) == FALSE)
found_in_cache = get_cached_desired_size (for_size, cache->desired_heights, &cached_size);
else
memset (cache->desired_heights, 0x0, N_CACHED_SIZES * sizeof (DesiredSize));
}
if (!found_in_cache)