From: Maik Fischer Date: Wed, 23 Nov 2011 12:34:58 +0000 (+0100) Subject: i3test.pm: open_(floating_)window: take arguments as hashref or key-value list X-Git-Tag: 4.2~225^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9b8d9f730340ea9d548ab18df45d892c5a2dfdde;p=i3%2Fi3 i3test.pm: open_(floating_)window: take arguments as hashref or key-value list --- diff --git a/testcases/lib/i3test.pm b/testcases/lib/i3test.pm index 0f2f2e07..f8ad4e2f 100644 --- a/testcases/lib/i3test.pm +++ b/testcases/lib/i3test.pm @@ -152,8 +152,7 @@ sub wait_for_unmap { # name => 'Window ' # sub open_window { - my ($args) = @_; - my %args = ($args ? %$args : ()); + my %args = @_ == 1 ? %{$_[0]} : @_; my $dont_map = delete $args{dont_map}; @@ -175,8 +174,7 @@ sub open_window { # Thin wrapper around open_window which sets window_type to # _NET_WM_WINDOW_TYPE_UTILITY to make the window floating. sub open_floating_window { - my ($args) = @_; - my %args = ($args ? %$args : ()); + my %args = @_ == 1 ? %{$_[0]} : @_; $args{window_type} = $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY');