tests: Extract focused_output in library

This commit is contained in:
Orestis Floros
2021-11-04 19:56:53 +01:00
parent bc4f35a6bb
commit 34ef7f8c33
3 changed files with 29 additions and 25 deletions

View File

@ -31,13 +31,6 @@ my $i3 = i3(get_socket_path());
# use 'focus output' and verify that focus gets changed appropriately
################################################################################
sub focused_output {
my $tree = $i3->get_tree->recv;
my $focused = $tree->{focus}->[0];
my $output = first { $_->{id} == $focused } @{$tree->{nodes}};
return $output->{name};
}
sync_with_i3;
$x->root->warp_pointer(0, 0);
sync_with_i3;