summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrol-center10
1 files changed, 6 insertions, 4 deletions
diff --git a/control-center b/control-center
index 85326ab3..3dae0126 100755
--- a/control-center
+++ b/control-center
@@ -383,7 +383,7 @@ sub exec_treeitem {
$tree_launched{$label}->[0]=$nb_pages;
$notebook_global->set_page($nb_pages);
$socket->realize;
- $socket->steal(launch_wait("kups", "kups"));
+ $socket->steal(launch_wait("kups", "kups",3));
$notebook_global->show_all();
$notebook_global->set_page($nb_pages);
return;
@@ -456,7 +456,7 @@ sub exec_treeitem {
}
sub launch_wait {
- my $exec, $grep = @_;
+ my $exec, $grep, $num = @_;
print "{{ $exec }}\n";
my $b = "xwininfo -root -tree -int | grep '" . $grep . "'";
my @before = split ('\n', `$b`);
@@ -466,10 +466,13 @@ sub launch_wait {
}
$pid_launched[$nb_pages] = $pid;
$nb_pages++;
- sleep(1);
my $res = 0;
while (!$res) {
my @after = split ('\n', `$b`);
+ while (@after ne ($num+@before)) {
+ @after = split ('\n', `$b`);
+ }
+
my $i = 0;
my $c;
foreach (@after) {
@@ -481,7 +484,6 @@ sub launch_wait {
$res=$1;
print "[" . $res . "]\n";
}
- sleep(1);
$res;
}