summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrol-center13
1 files changed, 9 insertions, 4 deletions
diff --git a/control-center b/control-center
index 4d555467..190a1aad 100755
--- a/control-center
+++ b/control-center
@@ -1054,7 +1054,7 @@ my @profiles;
my $mdk_rel = common::mandrake_release();
-my $notebook_global;
+my ($notebook_global, $saved_pos_while_in_menu);
my @menu_items = (
[ N("/_File"), undef, undef, undef, '<Branch>' ],
@@ -1074,7 +1074,7 @@ my @menu_items = (
[ join('', @{$options{expert_mode}}), undef,
sub {
$option_values{expert_mode} = $check_boxes{expert_mode}->get_active;
- my $pos = $notebook_global && $notebook_global->get_current_page;
+ $saved_pos_while_in_menu = $notebook_global && $notebook_global->get_current_page;
refresh_tree(1);
if ($notebook_global) {
if (!$emb_socket) {
@@ -1082,7 +1082,7 @@ my @menu_items = (
$notebook_global->queue_draw;
}
# restore previous position:
- $notebook_global->set_current_page($pos) if $pos != -1;
+ $notebook_global->set_current_page($saved_pos_while_in_menu) if $saved_pos_while_in_menu && $saved_pos_while_in_menu != -1;
}
},
undef, '<CheckItem>'
@@ -1329,7 +1329,12 @@ sub really_refresh_tree {
# 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) if $pos != -1;
+ if ($pos != -1) {
+ $notebook_global->set_current_page($pos);
+ } elsif ($saved_pos_while_in_menu) {
+ $notebook_global->set_current_page($saved_pos_while_in_menu);
+ undef $saved_pos_while_in_menu;
+ }
$notebook_global->window && $notebook_global->window->thaw_updates if $is_freezed;
$is_freezed = 0;
}