From 09f36f045b5aaf8f159a9b13a78c4240a7530ee5 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 3 Sep 2008 14:35:19 +0000 Subject: - fix buggy blocking wait_message occuring in diskdrake (using a more powerful strategy to ensure such blocking wait_message won't bother use anymore) --- perl-install/interactive/gtk.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'perl-install/interactive') diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 03832686a..5e2df3011 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -699,7 +699,6 @@ sub create_widgets { $mainw->{retval} = $v; Gtk2->main_quit; } - mygtk2::destroy_previous_popped_and_reuse_window(); $mainw->{rwindow}->show; $update->(); }; @@ -881,11 +880,15 @@ sub ask_from__add_modify_removeW { $o->ask_from($title, $message, $l, %callback); } +my $reuse_timeout; + sub wait_messageW { my ($o, $title, $message, $message_modifiable) = @_; my $to_modify = Gtk2::Label->new(scalar warp_text(ref $message_modifiable ? '' : $message_modifiable)); + Glib::Source->remove($reuse_timeout) if $reuse_timeout; $reuse_timeout = ''; + my $Window = gtknew('MagicWindow', title => $title, pop_it => defined $o->{pop_wait_messages} ? $o->{pop_wait_messages} : 1, @@ -912,10 +915,14 @@ sub wait_message_nextW { } sub wait_message_endW { my ($_o, $Window) = @_; - $Window->{pop_and_reuse} and return; - - mygtk2::may_destroy($Window); - mygtk2::flush(); + if ($Window->{pop_and_reuse}) { + $reuse_timeout = Glib::Timeout->add(100, sub { + mygtk2::destroy_previous_popped_and_reuse_window(); + }); + } else { + mygtk2::may_destroy($Window); + mygtk2::flush(); + } } sub wait_message_with_progress_bar { -- cgit v1.2.1