--- deliantra/Deliantra-Client/DC/UI.pm 2006/06/01 02:59:46 1.265 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/06/01 03:42:58 1.266 @@ -42,10 +42,11 @@ } sub check_tooltip { + return if $ENV{CFPLUS_DEBUG} & 8; + if (!$GRAB) { for (my $widget = $HOVER; $widget; $widget = $widget->{parent}) { if (length $widget->{tooltip}) { - if ($TOOLTIP->{owner} != $widget) { $TOOLTIP->hide; @@ -1525,7 +1526,7 @@ my ($self, $w, $h) = @_; delete $self->{texture} - ;#d# + unless $w >= $self->{req_w} && $self->{old_w} >= $self->{req_w}; } sub set_fontsize { @@ -3374,21 +3375,32 @@ } if ($self->{realloc}) { + my %queue; my @queue; + my $widget; + outer: while () { - if ($self->{realloc}) { - #TODO use array-of-depth approach + if (my $realloc = delete $self->{realloc}) { + for $widget (values %$realloc) { + $widget->{visible} or next; # do not resize invisible widgets - use sort 'stable'; + $queue{$widget+0}++ and next; # duplicates are common - @queue = sort { $a->{visible} <=> $b->{visible} } - @queue, values %{delete $self->{realloc}}; + push @{ $queue[$widget->{visible}] }, $widget; + } } - my $widget = pop @queue || last; + while () { + @queue or last outer; - $widget->{visible} or last; # do not resize invisible widgets + $widget = pop @{ $queue[-1] || [] } + and last; + + pop @queue; + } + + delete $queue{$widget+0}; my ($w, $h) = $widget->size_request; @@ -3406,8 +3418,9 @@ $self->{size_alloc}{$widget+0} = $widget; if (my $parent = $widget->{parent}) { - $self->{realloc}{$parent+0} = $parent; - #unshift @queue, $parent; + $self->{realloc}{$parent+0} = $parent + unless $queue{$parent+0}; + $parent->{force_size_alloc} = 1; $self->{size_alloc}{$parent+0} = $parent; } @@ -3433,6 +3446,9 @@ $h = int $h + 0.5; if ($widget->{w} != $w || $widget->{h} != $h || delete $widget->{force_size_alloc}) { + $widget->{old_w} = $widget->{w}; + $widget->{old_h} = $widget->{h}; + $widget->{w} = $w; $widget->{h} = $h;