Merge pull request #3816 from sandsmark/martin/empty-matches

Match empty window properties (e. g. no title set) #3308
This commit is contained in:
Orestis Floros
2020-04-10 11:44:46 +02:00
committed by GitHub
2 changed files with 18 additions and 8 deletions

View File

@ -33,9 +33,7 @@ my $win = $content->[0];
# not match it
######################################################################
# TODO: specify more match types
# we can match on any (non-empty) class here since that window does not have
# WM_CLASS set
cmd q|[class=".*"] kill|;
# Try matching with an empty pattern since there isn't a WM_CLASS set.
cmd q|[con_id="99999"] kill|;
is_num_children($tmp, 1, 'window still there');
@ -103,4 +101,18 @@ cmd '[title="^\w [3]$"] kill';
wait_for_unmap $left;
is_num_children($tmp, 0, 'window killed');
######################################################################
# check that we can match empty properties
######################################################################
$tmp = fresh_workspace;
$left = open_window(name => 'class is empty', wm_class => '');
ok($left->mapped, 'left window mapped');
is_num_children($tmp, 1, 'window opened');
cmd '[class="^$"] kill';
wait_for_unmap $left;
is_num_children($tmp, 0, 'window killed');
done_testing;