# vim:ts=4:sw=4:expandtab
use i3test;
-use X11::XCB qw(:all);
use List::Util qw(first);
-BEGIN {
- use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
-}
-
-my $x = X11::XCB::Connection->new;
-
my $tmp = fresh_workspace;
#####################################################################
cmd 'split v';
-my $top = open_window($x);
-my $bottom = open_window($x);
+my $top = open_window;
+my $bottom = open_window;
my @urgent = grep { $_->{urgent} } @{get_ws_content($tmp)};
is(@urgent, 0, 'no window got the urgent flag');
# Add the urgency hint, switch to a different workspace and back again
#####################################################################
$top->add_hint('urgency');
-sync_with_i3($x);
+sync_with_i3;
my @content = @{get_ws_content($tmp)};
@urgent = grep { $_->{urgent} } @content;
is(@urgent, 0, 'no window got the urgent flag after focusing');
$top->add_hint('urgency');
-sync_with_i3($x);
+sync_with_i3;
@urgent = grep { $_->{urgent} } @{get_ws_content($tmp)};
is(@urgent, 0, 'no window got the urgent flag after re-setting urgency hint');
my $otmp = fresh_workspace;
$top->add_hint('urgency');
-sync_with_i3($x);
+sync_with_i3;
$ws = get_ws($tmp);
ok($ws->{urgent}, 'urgent flag set on workspace');