From fce7570f961bcb373e1ac0965bb3ed41747e0d3b Mon Sep 17 00:00:00 2001 From: Maik Fischer Date: Tue, 22 Nov 2011 00:47:32 +0100 Subject: [PATCH] testcases: drop open_window()s $x parameter, use global one instead --- testcases/lib/i3test.pm | 4 +-- testcases/t/003-ipc.t | 2 +- testcases/t/101-focus.t | 6 ++--- testcases/t/102-dock.t | 10 +++---- testcases/t/104-focus-stack.t | 4 +-- testcases/t/111-goto.t | 6 ++--- testcases/t/113-urgent.t | 4 +-- testcases/t/114-client-leader.t | 10 +++---- testcases/t/119-match.t | 2 +- testcases/t/129-focus-after-close.t | 2 +- testcases/t/133-size-hints.t | 2 +- testcases/t/135-floating-focus.t | 26 +++++++++---------- testcases/t/138-floating-attach.t | 8 +++--- testcases/t/139-ws-numbers.t | 12 ++++----- testcases/t/140-focus-lost.t | 6 ++--- testcases/t/141-resize.t | 10 +++---- testcases/t/145-flattening.t | 6 ++--- testcases/t/146-floating-reinsert.t | 6 ++--- testcases/t/147-regress-floatingmove.t | 6 ++--- testcases/t/148-regress-floatingmovews.t | 4 +-- testcases/t/150-regress-dock-restart.t | 4 +-- testcases/t/153-floating-originalsize.t | 2 +- testcases/t/154-regress-multiple-dock.t | 4 +-- testcases/t/155-floating-split-size.t | 4 +-- testcases/t/156-fullscreen-focus.t | 6 ++--- testcases/t/157-regress-fullscreen-level-up.t | 2 +- testcases/t/158-wm_take_focus.t | 4 +-- testcases/t/161-regress-borders-restart.t | 2 +- testcases/t/163-wm-state.t | 2 +- testcases/t/164-kill-win-vs-client.t | 4 +-- testcases/t/165-for_window.t | 2 +- testcases/t/167-workspace_layout.t | 12 ++++----- testcases/t/168-regress-fullscreen-restart.t | 4 +-- testcases/t/170-force_focus_wrapping.t | 12 ++++----- testcases/t/174-border-config.t | 4 +-- testcases/t/175-startup-notification.t | 8 +++--- 36 files changed, 106 insertions(+), 106 deletions(-) diff --git a/testcases/lib/i3test.pm b/testcases/lib/i3test.pm index c94101e1..1ddaa52b 100644 --- a/testcases/lib/i3test.pm +++ b/testcases/lib/i3test.pm @@ -156,7 +156,7 @@ sub wait_for_unmap { # name => 'Window ' # sub open_window { - my ($x, $args) = @_; + my ($args) = @_; my %args = ($args ? %$args : ()); my $dont_map = delete $args{dont_map}; @@ -186,7 +186,7 @@ sub open_floating_window { $args{window_type} = $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'); - return open_window($x, \%args); + return open_window(\%args); } sub open_empty_con { diff --git a/testcases/t/003-ipc.t b/testcases/t/003-ipc.t index 296375ab..477b7163 100644 --- a/testcases/t/003-ipc.t +++ b/testcases/t/003-ipc.t @@ -10,7 +10,7 @@ fresh_workspace; ##################################################################### # Create a window so we can get a focus different from NULL -my $window = open_window($x); +my $window = open_window; my $focus = $x->input_focus; diff --git a/testcases/t/101-focus.t b/testcases/t/101-focus.t index 070d1385..545b9dd0 100644 --- a/testcases/t/101-focus.t +++ b/testcases/t/101-focus.t @@ -13,9 +13,9 @@ my $tmp = fresh_workspace; cmd 'layout default'; cmd 'split v'; -my $top = open_window($x); -my $mid = open_window($x); -my $bottom = open_window($x); +my $top = open_window; +my $mid = open_window; +my $bottom = open_window; # # Returns the input focus after sending the given command to i3 via IPC diff --git a/testcases/t/102-dock.t b/testcases/t/102-dock.t index f97fa21c..ce33f052 100644 --- a/testcases/t/102-dock.t +++ b/testcases/t/102-dock.t @@ -23,7 +23,7 @@ my $screens = $x->screens; my $primary = first { $_->primary } @{$screens}; # TODO: focus the primary screen before -my $window = open_window($x, { +my $window = open_window({ window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'), }); @@ -76,7 +76,7 @@ is(@docked, 0, 'no more dock clients'); # check if it gets placed on bottom (by coordinates) ##################################################################### -$window = open_window($x, { +$window = open_window({ rect => [ 0, 1000, 30, 30 ], background_color => '#FF0000', window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'), @@ -100,7 +100,7 @@ is(@docked, 0, 'no more dock clients'); # check if it gets placed on bottom (by hint) ##################################################################### -$window = open_window($x, { +$window = open_window({ dont_map => 1, rect => [ 0, 1000, 30, 30 ], background_color => '#FF0000', @@ -137,7 +137,7 @@ wait_for_unmap $window; @docked = get_dock_clients(); is(@docked, 0, 'no more dock clients'); -$window = open_window($x, { +$window = open_window({ dont_map => 1, rect => [ 0, 1000, 30, 30 ], background_color => '#FF0000', @@ -174,7 +174,7 @@ $window->destroy; # regression test: transient dock client ##################################################################### -my $fwindow = open_window($x, { +my $fwindow = open_window({ dont_map => 1, background_color => '#FF0000', window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'), diff --git a/testcases/t/104-focus-stack.t b/testcases/t/104-focus-stack.t index 1128e16a..f72cd75f 100644 --- a/testcases/t/104-focus-stack.t +++ b/testcases/t/104-focus-stack.t @@ -8,8 +8,8 @@ use i3test; fresh_workspace; cmd 'split h'; -my $tiled_left = open_window($x); -my $tiled_right = open_window($x); +my $tiled_left = open_window; +my $tiled_right = open_window; # Get input focus before creating the floating window my $focus = $x->input_focus; diff --git a/testcases/t/111-goto.t b/testcases/t/111-goto.t index 0da9e8e0..5f4d7762 100644 --- a/testcases/t/111-goto.t +++ b/testcases/t/111-goto.t @@ -12,9 +12,9 @@ cmd 'split h'; # Create two windows and make sure focus switching works ##################################################################### -my $top = open_window($x); -my $mid = open_window($x); -my $bottom = open_window($x); +my $top = open_window; +my $mid = open_window; +my $bottom = open_window; # # Returns the input focus after sending the given command to i3 via IPC diff --git a/testcases/t/113-urgent.t b/testcases/t/113-urgent.t index 2b78b882..fcfd11e7 100644 --- a/testcases/t/113-urgent.t +++ b/testcases/t/113-urgent.t @@ -12,8 +12,8 @@ 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'); diff --git a/testcases/t/114-client-leader.t b/testcases/t/114-client-leader.t index 4d6ecc51..3b0bddc0 100644 --- a/testcases/t/114-client-leader.t +++ b/testcases/t/114-client-leader.t @@ -13,8 +13,8 @@ my $tmp = fresh_workspace; # one of both (depending on your screen resolution) will be positioned wrong. #################################################################################### -my $left = open_window($x, { name => 'Left' }); -my $right = open_window($x, { name => 'Right' }); +my $left = open_window({ name => 'Left' }); +my $right = open_window({ name => 'Right' }); my ($abs, $rgeom) = $right->rect; @@ -44,7 +44,7 @@ ok(wait_for_map($child2), 'second child window mapped'); cmp_ok(($cgeom->x + $cgeom->width), '<', $rgeom->x, 'child above left window'); # check wm_transient_for -my $fwindow = open_window($x, { dont_map => 1 }); +my $fwindow = open_window({ dont_map => 1 }); $fwindow->transient_for($right); $fwindow->map; @@ -60,7 +60,7 @@ SKIP: { # Create a parent window ##################################################################### -my $window = open_window($x, { dont_map => 1, name => 'Parent window' }); +my $window = open_window({ dont_map => 1, name => 'Parent window' }); $window->map; ok(wait_for_map($window), 'parent window mapped'); @@ -71,7 +71,7 @@ ok(wait_for_map($window), 'parent window mapped'); ######################################################################### fresh_workspace; -my $child = open_window($x, { dont_map => 1, name => 'Child window' }); +my $child = open_window({ dont_map => 1, name => 'Child window' }); $child->client_leader($window); $child->map; diff --git a/testcases/t/119-match.t b/testcases/t/119-match.t index cad8163f..e2e553f4 100644 --- a/testcases/t/119-match.t +++ b/testcases/t/119-match.t @@ -11,7 +11,7 @@ my $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); # Open a new window -my $window = open_window($x); +my $window = open_window; my $content = get_ws_content($tmp); ok(@{$content} == 1, 'window mapped'); my $win = $content->[0]; diff --git a/testcases/t/129-focus-after-close.t b/testcases/t/129-focus-after-close.t index 1bb2eedc..3913f4c6 100644 --- a/testcases/t/129-focus-after-close.t +++ b/testcases/t/129-focus-after-close.t @@ -99,7 +99,7 @@ $first = open_empty_con($i3); $middle = open_empty_con($i3); # XXX: the $right empty con will be filled with the x11 window we are creating afterwards $right = open_empty_con($i3); -my $win = open_window($x, { background_color => '#00ff00' }); +my $win = open_window({ background_color => '#00ff00' }); cmd qq|[con_id="$middle"] focus|; $win->destroy; diff --git a/testcases/t/133-size-hints.t b/testcases/t/133-size-hints.t index cad6bb71..34b5e4a5 100644 --- a/testcases/t/133-size-hints.t +++ b/testcases/t/133-size-hints.t @@ -9,7 +9,7 @@ my $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); -my $win = open_window($x, { dont_map => 1 }); +my $win = open_window({ dont_map => 1 }); # XXX: we should check screen size. in screens with an AR of 2.0, # this is not a good idea. my $aspect = X11::XCB::Sizehints::Aspect->new; diff --git a/testcases/t/135-floating-focus.t b/testcases/t/135-floating-focus.t index d5b70008..37d141b1 100644 --- a/testcases/t/135-floating-focus.t +++ b/testcases/t/135-floating-focus.t @@ -9,8 +9,8 @@ my $tmp = fresh_workspace; # 1: see if focus stays the same when toggling tiling/floating mode ############################################################################# -my $first = open_window($x); -my $second = open_window($x); +my $first = open_window; +my $second = open_window; is($x->input_focus, $second->id, 'second window focused'); @@ -26,9 +26,9 @@ is($x->input_focus, $second->id, 'second window still focused after mode toggle' $tmp = fresh_workspace; -$first = open_window($x); # window 2 -$second = open_window($x); # window 3 -my $third = open_window($x); # window 4 +$first = open_window; # window 2 +$second = open_window; # window 3 +my $third = open_window; # window 4 is($x->input_focus, $third->id, 'last container focused'); @@ -57,9 +57,9 @@ is($x->input_focus, $second->id, 'second con still focused after killing third') $tmp = fresh_workspace; -$first = open_window($x, { background_color => '#ff0000' }); # window 5 -$second = open_window($x, { background_color => '#00ff00' }); # window 6 -$third = open_window($x, { background_color => '#0000ff' }); # window 7 +$first = open_window({ background_color => '#ff0000' }); # window 5 +$second = open_window({ background_color => '#00ff00' }); # window 6 +$third = open_window({ background_color => '#0000ff' }); # window 7 is($x->input_focus, $third->id, 'last container focused'); @@ -91,11 +91,11 @@ is($x->input_focus, $first->id, 'first con focused after killing all floating co $tmp = fresh_workspace; -$first = open_window($x, { background_color => '#ff0000' }); # window 5 +$first = open_window({ background_color => '#ff0000' }); # window 5 cmd 'split v'; cmd 'layout stacked'; -$second = open_window($x, { background_color => '#00ff00' }); # window 6 -$third = open_window($x, { background_color => '#0000ff' }); # window 7 +$second = open_window({ background_color => '#00ff00' }); # window 6 +$third = open_window({ background_color => '#0000ff' }); # window 7 is($x->input_focus, $third->id, 'last container focused'); @@ -129,8 +129,8 @@ is($x->input_focus, $first->id, 'first con focused after killing all floating co $tmp = fresh_workspace; -$first = open_window($x, { background_color => '#ff0000' }); # window 8 -$second = open_window($x, { background_color => '#00ff00' }); # window 9 +$first = open_window({ background_color => '#ff0000' }); # window 8 +$second = open_window({ background_color => '#00ff00' }); # window 9 sync_with_i3($x); diff --git a/testcases/t/138-floating-attach.t b/testcases/t/138-floating-attach.t index 9a7996b1..71f10ef5 100644 --- a/testcases/t/138-floating-attach.t +++ b/testcases/t/138-floating-attach.t @@ -24,7 +24,7 @@ is(@{$ws->{floating_nodes}}, 1, 'one floating node'); is(@{$nodes}, 0, 'no tiling nodes'); # Create a tiling window -my $twindow = open_window($x); +my $twindow = open_window; ($nodes, $focus) = get_ws_content($tmp); @@ -37,8 +37,8 @@ is(@{$nodes}, 1, 'one tiling node'); $tmp = fresh_workspace; -my $first = open_window($x); -my $second = open_window($x); +my $first = open_window; +my $second = open_window; cmd 'layout stacked'; @@ -54,7 +54,7 @@ $ws = get_ws($tmp); is(@{$ws->{floating_nodes}}, 1, 'one floating nodes'); is(@{$ws->{nodes}}, 1, 'one tiling node (stacked con)'); -my $third = open_window($x); +my $third = open_window; $ws = get_ws($tmp); diff --git a/testcases/t/139-ws-numbers.t b/testcases/t/139-ws-numbers.t index 9d73ad1c..aac1debf 100644 --- a/testcases/t/139-ws-numbers.t +++ b/testcases/t/139-ws-numbers.t @@ -24,7 +24,7 @@ check_order('workspace order alright before testing'); cmd "workspace 93"; -open_window($x); +open_window; my @ws = @{$i3->get_workspaces->recv}; my @f = grep { defined($_->{num}) && $_->{num} == 93 } @ws; @@ -32,23 +32,23 @@ is(@f, 1, 'ws 93 found by num'); check_order('workspace order alright after opening 93'); cmd "workspace 92"; -open_window($x); +open_window; check_order('workspace order alright after opening 92'); cmd "workspace 94"; -open_window($x); +open_window; check_order('workspace order alright after opening 94'); cmd "workspace 96"; -open_window($x); +open_window; check_order('workspace order alright after opening 96'); cmd "workspace foo"; -open_window($x); +open_window; check_order('workspace order alright after opening foo'); cmd "workspace 91"; -open_window($x); +open_window; check_order('workspace order alright after opening 91'); done_testing; diff --git a/testcases/t/140-focus-lost.t b/testcases/t/140-focus-lost.t index cd6eee38..042afcfe 100644 --- a/testcases/t/140-focus-lost.t +++ b/testcases/t/140-focus-lost.t @@ -18,9 +18,9 @@ sub check_order { my $tmp = fresh_workspace; -my $left = open_window($x); -my $mid = open_window($x); -my $right = open_window($x); +my $left = open_window; +my $mid = open_window; +my $right = open_window; sync_with_i3($x); diff --git a/testcases/t/141-resize.t b/testcases/t/141-resize.t index 18e28ccb..b2c7d0f3 100644 --- a/testcases/t/141-resize.t +++ b/testcases/t/141-resize.t @@ -7,8 +7,8 @@ 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; sync_with_i3($x); @@ -47,8 +47,8 @@ $tmp = fresh_workspace; cmd 'split v'; -$top = open_window($x); -$bottom = open_window($x); +$top = open_window; +$bottom = open_window; cmd 'split h'; cmd 'layout stacked'; @@ -69,7 +69,7 @@ is($nodes->[1]->{percent}, 0.75, 'bottom window got 75%'); $tmp = fresh_workspace; -$top = open_window($x); +$top = open_window; cmd 'floating enable'; diff --git a/testcases/t/145-flattening.t b/testcases/t/145-flattening.t index 8baf9217..9d22afc3 100644 --- a/testcases/t/145-flattening.t +++ b/testcases/t/145-flattening.t @@ -14,9 +14,9 @@ use i3test; my $tmp = fresh_workspace; -my $left = open_window($x); -my $mid = open_window($x); -my $right = open_window($x); +my $left = open_window; +my $mid = open_window; +my $right = open_window; cmd 'move up'; cmd 'move right'; diff --git a/testcases/t/146-floating-reinsert.t b/testcases/t/146-floating-reinsert.t index 1015f8f8..c3a4512a 100644 --- a/testcases/t/146-floating-reinsert.t +++ b/testcases/t/146-floating-reinsert.t @@ -5,11 +5,11 @@ use i3test; my $tmp = fresh_workspace; -my $left = open_window($x); -my $mid = open_window($x); +my $left = open_window; +my $mid = open_window; cmd 'split v'; -my $bottom = open_window($x); +my $bottom = open_window; my ($nodes, $focus) = get_ws_content($tmp); diff --git a/testcases/t/147-regress-floatingmove.t b/testcases/t/147-regress-floatingmove.t index 74adef69..ed85b57b 100644 --- a/testcases/t/147-regress-floatingmove.t +++ b/testcases/t/147-regress-floatingmove.t @@ -8,9 +8,9 @@ use i3test; my $tmp = fresh_workspace; -my $left = open_window($x); -my $mid = open_window($x); -my $right = open_window($x); +my $left = open_window; +my $mid = open_window; +my $right = open_window; # go to workspace level cmd 'level up'; diff --git a/testcases/t/148-regress-floatingmovews.t b/testcases/t/148-regress-floatingmovews.t index 0e6345b2..44d5a445 100644 --- a/testcases/t/148-regress-floatingmovews.t +++ b/testcases/t/148-regress-floatingmovews.t @@ -9,13 +9,13 @@ use i3test; my $tmp = fresh_workspace; # open a tiling window on the first workspace -open_window($x); +open_window; #sleep 0.25; my $first = get_focused($tmp); # on a different ws, open a floating window my $otmp = fresh_workspace; -open_window($x); +open_window; #sleep 0.25; my $float = get_focused($otmp); cmd 'mode toggle'; diff --git a/testcases/t/150-regress-dock-restart.t b/testcases/t/150-regress-dock-restart.t index 5317eef3..7e5a5520 100644 --- a/testcases/t/150-regress-dock-restart.t +++ b/testcases/t/150-regress-dock-restart.t @@ -18,7 +18,7 @@ is(@docked, 0, 'no dock clients yet'); # open a dock client -my $window = open_window($x, { +my $window = open_window({ background_color => '#FF0000', window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'), }); @@ -64,7 +64,7 @@ is(@docked, 0, 'no dock clients found'); # create a dock client with a 1px border ##################################################################### -$window = open_window($x, { +$window = open_window({ border => 1, rect => [ 0, 0, 30, 20 ], background_color => '#00FF00', diff --git a/testcases/t/153-floating-originalsize.t b/testcases/t/153-floating-originalsize.t index 2c798cfa..dcd1144e 100644 --- a/testcases/t/153-floating-originalsize.t +++ b/testcases/t/153-floating-originalsize.t @@ -8,7 +8,7 @@ use i3test; my $tmp = fresh_workspace; # Create a floating window which is smaller than the minimum enforced size of i3 -my $window = open_window($x, { rect => [ 0, 0, 400, 150 ] }); +my $window = open_window({ rect => [ 0, 0, 400, 150 ] }); my ($absolute, $top) = $window->rect; diff --git a/testcases/t/154-regress-multiple-dock.t b/testcases/t/154-regress-multiple-dock.t index 52ab4004..76577fb3 100644 --- a/testcases/t/154-regress-multiple-dock.t +++ b/testcases/t/154-regress-multiple-dock.t @@ -20,7 +20,7 @@ is(@docked, 0, 'no dock clients yet'); # open a dock client ##################################################################### -my $first = open_window($x, { +my $first = open_window({ background_color => '#FF0000', window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'), }); @@ -29,7 +29,7 @@ my $first = open_window($x, { # Open a second dock client ##################################################################### -my $second = open_window($x, { +my $second = open_window({ background_color => '#FF0000', window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'), }); diff --git a/testcases/t/155-floating-split-size.t b/testcases/t/155-floating-split-size.t index 618266b6..76c31af6 100644 --- a/testcases/t/155-floating-split-size.t +++ b/testcases/t/155-floating-split-size.t @@ -12,7 +12,7 @@ my $tmp = fresh_workspace; # open a window with 200x80 ##################################################################### -my $first = open_window($x, { +my $first = open_window({ rect => [ 0, 0, 200, 80], background_color => '#FF0000', }); @@ -21,7 +21,7 @@ my $first = open_window($x, { # Open a second window with 300x90 ##################################################################### -my $second = open_window($x, { +my $second = open_window({ rect => [ 0, 0, 300, 90], background_color => '#00FF00', }); diff --git a/testcases/t/156-fullscreen-focus.t b/testcases/t/156-fullscreen-focus.t index e188b375..78323990 100644 --- a/testcases/t/156-fullscreen-focus.t +++ b/testcases/t/156-fullscreen-focus.t @@ -14,7 +14,7 @@ my $tmp = fresh_workspace; # open the left window ##################################################################### -my $left = open_window($x, { background_color => '#ff0000' }); +my $left = open_window({ background_color => '#ff0000' }); is($x->input_focus, $left->id, 'left window focused'); @@ -24,7 +24,7 @@ diag("left = " . $left->id); # Open the right window ##################################################################### -my $right = open_window($x, { background_color => '#00ff00' }); +my $right = open_window({ background_color => '#00ff00' }); diag("right = " . $right->id); @@ -38,7 +38,7 @@ cmd 'fullscreen'; # Open a third window ##################################################################### -my $third = open_window($x, { +my $third = open_window({ background_color => '#0000ff', name => 'Third window', dont_map => 1, diff --git a/testcases/t/157-regress-fullscreen-level-up.t b/testcases/t/157-regress-fullscreen-level-up.t index 2c9c4b17..a861117c 100644 --- a/testcases/t/157-regress-fullscreen-level-up.t +++ b/testcases/t/157-regress-fullscreen-level-up.t @@ -11,7 +11,7 @@ my $tmp = fresh_workspace; # open a window, verify it’s not in fullscreen mode ##################################################################### -my $win = open_window($x); +my $win = open_window; my $nodes = get_ws_content $tmp; is(@$nodes, 1, 'exactly one client'); diff --git a/testcases/t/158-wm_take_focus.t b/testcases/t/158-wm_take_focus.t index 0580b9c9..94476bbd 100644 --- a/testcases/t/158-wm_take_focus.t +++ b/testcases/t/158-wm_take_focus.t @@ -8,7 +8,7 @@ use i3test; subtest 'Window without WM_TAKE_FOCUS', sub { fresh_workspace; - my $window = open_window($x); + my $window = open_window; ok(!wait_for_event(1, sub { $_[0]->{response_type} == 161 }), 'did not receive ClientMessage'); @@ -20,7 +20,7 @@ subtest 'Window with WM_TAKE_FOCUS', sub { my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS'); - my $window = open_window($x, { + my $window = open_window({ dont_map => 1, protocols => [ $take_focus ], }); diff --git a/testcases/t/161-regress-borders-restart.t b/testcases/t/161-regress-borders-restart.t index ce53b002..6e1f64f0 100644 --- a/testcases/t/161-regress-borders-restart.t +++ b/testcases/t/161-regress-borders-restart.t @@ -10,7 +10,7 @@ use i3test; my $i3 = i3(get_socket_path()); my $tmp = fresh_workspace; -my $window = open_window($x); +my $window = open_window; sub get_border_style { my @content = @{get_ws_content($tmp)}; diff --git a/testcases/t/163-wm-state.t b/testcases/t/163-wm-state.t index f3e7e2d1..468499d5 100644 --- a/testcases/t/163-wm-state.t +++ b/testcases/t/163-wm-state.t @@ -7,7 +7,7 @@ use i3test; use X11::XCB qw(ICCCM_WM_STATE_NORMAL ICCCM_WM_STATE_WITHDRAWN); -my $window = open_window($x); +my $window = open_window; sync_with_i3($x); diff --git a/testcases/t/164-kill-win-vs-client.t b/testcases/t/164-kill-win-vs-client.t index df9b7fd8..20dd50ca 100644 --- a/testcases/t/164-kill-win-vs-client.t +++ b/testcases/t/164-kill-win-vs-client.t @@ -11,8 +11,8 @@ sub two_windows { ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); - my $first = open_window($x); - my $second = open_window($x); + my $first = open_window; + my $second = open_window; sync_with_i3 $x; diff --git a/testcases/t/165-for_window.t b/testcases/t/165-for_window.t index 80649771..281f840f 100644 --- a/testcases/t/165-for_window.t +++ b/testcases/t/165-for_window.t @@ -183,7 +183,7 @@ wait_for_map $window; cmp_ok(@content, '==', 1, 'one node on this workspace now'); is($content[0]->{border}, 'none', 'no border'); -my $other = open_window($x); +my $other = open_window; @content = @{get_ws_content($tmp)}; cmp_ok(@content, '==', 2, 'two nodes'); diff --git a/testcases/t/167-workspace_layout.t b/testcases/t/167-workspace_layout.t index 2744c9ba..d5a02ca6 100644 --- a/testcases/t/167-workspace_layout.t +++ b/testcases/t/167-workspace_layout.t @@ -23,8 +23,8 @@ my $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); -my $first = open_window($x); -my $second = open_window($x); +my $first = open_window; +my $second = open_window; sync_with_i3($x); @@ -53,8 +53,8 @@ $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); -$first = open_window($x); -$second = open_window($x); +$first = open_window; +$second = open_window; sync_with_i3($x); @@ -69,8 +69,8 @@ is($content[0]->{layout}, 'stacked', 'layout stacked'); ##################################################################### cmd 'focus parent'; -my $right_top = open_window($x); -my $right_bot = open_window($x); +my $right_top = open_window; +my $right_bot = open_window; @content = @{get_ws_content($tmp)}; is(@content, 2, 'two cons at workspace level after focus parent'); diff --git a/testcases/t/168-regress-fullscreen-restart.t b/testcases/t/168-regress-fullscreen-restart.t index 70bddd8e..74d284db 100644 --- a/testcases/t/168-regress-fullscreen-restart.t +++ b/testcases/t/168-regress-fullscreen-restart.t @@ -7,8 +7,8 @@ use i3test; fresh_workspace; -open_window($x); -open_window($x); +open_window; +open_window; cmd 'layout stacking'; sleep 1; diff --git a/testcases/t/170-force_focus_wrapping.t b/testcases/t/170-force_focus_wrapping.t index b8920c2d..bf66c44e 100644 --- a/testcases/t/170-force_focus_wrapping.t +++ b/testcases/t/170-force_focus_wrapping.t @@ -21,13 +21,13 @@ my $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); -my $first = open_window($x); -my $second = open_window($x); +my $first = open_window; +my $second = open_window; cmd 'layout tabbed'; cmd 'focus parent'; -my $third = open_window($x); +my $third = open_window; is($x->input_focus, $third->id, 'third window focused'); cmd 'focus left'; @@ -62,13 +62,13 @@ $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); -$first = open_window($x); -$second = open_window($x); +$first = open_window; +$second = open_window; cmd 'layout tabbed'; cmd 'focus parent'; -$third = open_window($x); +$third = open_window; sync_with_i3($x); diff --git a/testcases/t/174-border-config.t b/testcases/t/174-border-config.t index a27126cb..6196b684 100644 --- a/testcases/t/174-border-config.t +++ b/testcases/t/174-border-config.t @@ -23,7 +23,7 @@ my $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); -my $first = open_window($x); +my $first = open_window; my @content = @{get_ws_content($tmp)}; ok(@content == 1, 'one container opened'); @@ -49,7 +49,7 @@ $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); -$first = open_window($x); +$first = open_window; @content = @{get_ws_content($tmp)}; ok(@content == 1, 'one container opened'); diff --git a/testcases/t/175-startup-notification.t b/testcases/t/175-startup-notification.t index b624508b..a794f70a 100644 --- a/testcases/t/175-startup-notification.t +++ b/testcases/t/175-startup-notification.t @@ -97,7 +97,7 @@ my $second_ws = fresh_workspace; is(@{get_ws_content($second_ws)}, 0, 'no containers on the second workspace yet'); -my $win = open_window($x, { dont_map => 1 }); +my $win = open_window({ dont_map => 1 }); mark_window($win->id); $win->map; # We don’t use wait_for_map because the window will not get mapped -- it is on @@ -112,10 +112,10 @@ is(@{get_ws_content($first_ws)}, 1, 'one container on the first workspace'); # same thing, but with _NET_STARTUP_ID set on the leader ###################################################################### -my $leader = open_window($x, { dont_map => 1 }); +my $leader = open_window({ dont_map => 1 }); mark_window($leader->id); -$win = open_window($x, { dont_map => 1, client_leader => $leader }); +$win = open_window({ dont_map => 1, client_leader => $leader }); $win->map; sync_with_i3($x); @@ -130,7 +130,7 @@ is(@{get_ws_content($first_ws)}, 2, 'two containers on the first workspace'); complete_startup(); sync_with_i3($x); -my $otherwin = open_window($x); +my $otherwin = open_window; is(@{get_ws_content($second_ws)}, 1, 'one container on the second workspace'); ###################################################################### -- 2.39.2