i3test.pm: open_(floating_)window: take arguments as hashref or key-value list

This commit is contained in:
Maik Fischer 2011-11-23 13:34:58 +01:00 committed by Michael Stapelberg
parent c2229b905a
commit 9b8d9f7303
1 changed files with 2 additions and 4 deletions

View File

@ -152,8 +152,7 @@ sub wait_for_unmap {
# name => 'Window <n>' # name => 'Window <n>'
# #
sub open_window { sub open_window {
my ($args) = @_; my %args = @_ == 1 ? %{$_[0]} : @_;
my %args = ($args ? %$args : ());
my $dont_map = delete $args{dont_map}; my $dont_map = delete $args{dont_map};
@ -175,8 +174,7 @@ sub open_window {
# Thin wrapper around open_window which sets window_type to # Thin wrapper around open_window which sets window_type to
# _NET_WM_WINDOW_TYPE_UTILITY to make the window floating. # _NET_WM_WINDOW_TYPE_UTILITY to make the window floating.
sub open_floating_window { sub open_floating_window {
my ($args) = @_; my %args = @_ == 1 ? %{$_[0]} : @_;
my %args = ($args ? %$args : ());
$args{window_type} = $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'); $args{window_type} = $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY');