summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrol-center26
1 files changed, 16 insertions, 10 deletions
diff --git a/control-center b/control-center
index bebd0d11..1386d4de 100755
--- a/control-center
+++ b/control-center
@@ -1260,11 +1260,21 @@ my $spacing = 25;
my %tool_callbacks;
-my $page_count;
+my ($page_count, $need_to_refresh);
+
+sub really_refresh_tree {
+ my $pos = $notebook_global->get_current_page;
+ $notebook_global->show_all;
+ $notebook_global->queue_draw;
+ # workaround buggy gtk+:
+ $notebook_global->set_current_page($page_count-$_-1) foreach 0..$page_count-1;
+ # restore previous position:
+ $notebook_global->set_current_page($pos);
+ $notebook_global->window && $notebook_global->window->thaw_updates;
+}
sub refresh_tree {
my ($mode) = @_;
- my $pos = $notebook_global->get_current_page;
if ($mode && $page_count) {
$notebook_global->window && $notebook_global->window->freeze_updates;
$notebook_global->remove_page(-1) foreach 0..$page_count-1;
@@ -1349,14 +1359,8 @@ foreach (@tree) {
add2notebook($banner_notebook, "", Gtk2::Banner->new($icon, $text)) if !$mode;
}
- if ($mode) {
- $notebook_global->show_all;
- # workaround buggy gtk+:
- $notebook_global->set_current_page($page_count-$_-1) foreach 0..$page_count-1;
- # restore previous position:
- $notebook_global->set_current_page($pos);
- $notebook_global->window && $notebook_global->window->thaw_updates;
- }
+ $need_to_refresh = defined($emb_socket);
+ really_refresh_tree() if $mode && !$need_to_refresh;
}
refresh_tree();
@@ -1507,6 +1511,8 @@ sub create_hidden_socket {
Gtk2::HSeparator->new,
),
1, gtksignal_connect($emb_socket = Gtk2::Socket->new, 'plug-removed' => sub {
+ # handle expert mode switch:
+ really_refresh_tree() if $need_to_refresh;
$menu->show if $application_driven_menu;
$banner->destroy;
child_just_exited();