summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-09-14 11:52:37 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-09-14 11:52:37 +0000
commit1e578b3546cb5f0aafd2bdc44d20f67dcfb1226a (patch)
tree0334bb4cf35ccde8ddf287cb78e2630969000fd0
parent0edfecce021220aeab274857313893f3d8b1b61b (diff)
downloadcontrol-center-1e578b3546cb5f0aafd2bdc44d20f67dcfb1226a.tar
control-center-1e578b3546cb5f0aafd2bdc44d20f67dcfb1226a.tar.gz
control-center-1e578b3546cb5f0aafd2bdc44d20f67dcfb1226a.tar.bz2
control-center-1e578b3546cb5f0aafd2bdc44d20f67dcfb1226a.tar.xz
control-center-1e578b3546cb5f0aafd2bdc44d20f67dcfb1226a.zip
fix restoring position while a tool is embedded
-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;
}