From ab3db48ce5aff960b15bc5d5b00567837a611617 Mon Sep 17 00:00:00 2001 From: Yves Duret Date: Thu, 21 Jun 2001 11:52:05 +0000 Subject: fist the sleep we must live nude !! --- control-center | 10 ++++++---- 1 file 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; } -- cgit v1.2.1