summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrol-center334
1 files changed, 18 insertions, 16 deletions
diff --git a/control-center3 b/control-center3
index f12266a2..e0aa84c3 100755
--- a/control-center3
+++ b/control-center3
@@ -26,6 +26,7 @@ use POSIX;
# for i18n
use Locale::GetText;
+use sigtrap;
setlocale (LC_ALL, "");
Locale::GetText::textdomain ("DrakConf");
@@ -174,7 +175,7 @@ $SIG{USR1} = sub {
${$tree_launched{$_}->[1]}->deselect() foreach (keys %tree_launched);
$notebook_global->set_page(0);
}; # embedded applications will send me that signal in order to "hide" them
-$SIG{TERM} = sub { quit_global(); }; # embedded applications will send me that signal in order to quit the cc.
+$SIG{TERM} = \&quit_global; # embedded applications will send me that signal in order to quit the cc.
my $global_vbox;
my $global_time_tag;
my $lock_time_tag;
@@ -184,6 +185,8 @@ $SIG{USR2} = sub { Gtk->timeout_remove($lock_time_tag);
${$tree_launched{$_}->[1]} and ${$tree_launched{$_}->[1]}->set_sensitive(1) foreach (keys %tree_launched);
};
+#$SIG{CHLD} = \&chld_handler;
+
my $pix_dbl = new Gtk::Gdk::Pixmap($darea1->window, 540,460);
draw_exposed($pix_dbl);
$darea1->signal_connect( expose_event => sub { $darea1->window->draw_pixmap
@@ -234,10 +237,6 @@ sub gtkcreate_png {
}
sub quit_global {
- foreach(@pid_launched)
- {
- print "$_\n";
- }
kill TERM, @pid_launched;
Gtk->exit(0);
}
@@ -463,24 +462,27 @@ sub exec_treeitem {
$anim_nb > 9 and $anim_nb=0;
1;
});
- $lock_time_tag = Gtk->timeout_add(20000, sub {
- Gtk->timeout_remove($global_time_tag);
- ${$tree_launched{$_}->[1]} and ${$tree_launched{$_}->[1]}->set_sensitive(1) foreach (keys %tree_launched);
- $vbox->pack_start(new Gtk::Label (_("After 20 sec., this application didn't appear.\nIt's probably buggy")), 1, 1, 0);
- $label_->set(_("After 20 sec., this application didn't appear.\nIt's probably buggy")); $darea1->hide;
- });
- $socket->realize;
- # $label->destroy;
+ $lock_time_tag = Gtk->timeout_add(20000, sub {
+ Gtk->timeout_remove($global_time_tag);
+ ${$tree_launched{$_}->[1]} and ${$tree_launched{$_}->[1]}->set_sensitive(1) foreach (keys %tree_launched);
+ $vbox->pack_start(new Gtk::Label (_("After 20 sec., this application didn't appear.\nIt's probably buggy")), 1, 1, 0);
+ $label_->set(_("After 20 sec., this application didn't appear.\nIt's probably buggy")); $darea1->hide;
+ });
+
+$socket->realize;
+# $label->destroy;
my $a = $exec_string . " --embedded " . $socket->window->XWINDOW . " " . $$;
my $pid;
#($pid = fork) ? $pid_launched[$nb_pages] = $pid : system($a) == 0 or splash_warning(_("couldn't exec $a: $!"));
unless ($pid = fork) {
splash_warning(_("cannot fork: $~")) unless defined $pid;
-system("$a");
-waitpid(-1,WNOHANG);
+ exec("$a");
}
-$pid_launched[$nb_pages] = $pid;
+$pid_launched[$nb_pages-1] = $pid;
+
+print "test 1\n $nb_pages\n";
+print "$pid_launched[$nb_pages]\n";
} else {
$notebook_global->set_page($tree_launched{$label}->[0]);
}