# 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 ($x, $args) = @_;
+ my ($args) = @_;
my %args = ($args ? %$args : ());
$args{window_type} = $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY');
my $focus = $x->input_focus;
# Create a floating window which is smaller than the minimum enforced size of i3
-my $window = open_floating_window($x);
+my $window = open_floating_window;
is($x->input_focus, $window->id, 'floating window focused');
# Create a floating window and see if resizing works
#####################################################################
-my $window = open_floating_window($x);
+my $window = open_floating_window;
# See if configurerequests cause window movements (they should not)
my ($a, $t) = $window->rect;
my ($abs, $rgeom) = $right->rect;
-my $child = open_floating_window($x, {
+my $child = open_floating_window({
dont_map => 1,
name => 'Child window',
});
($abs, $cgeom) = $child->rect;
cmp_ok($cgeom->x, '>=', $rgeom->x, 'Child X >= right container X');
-my $child2 = open_floating_window($x, {
+my $child2 = open_floating_window({
dont_map => 1,
name => 'Child window 2',
});
######################################################################
$tmp = fresh_workspace;
-my $floatwin = open_floating_window($x);
+my $floatwin = open_floating_window;
my ($absolute_before, $top_before) = $floatwin->rect;
cmd 'move left';
$tmp = fresh_workspace;
-$first = open_floating_window($x, { background_color => '#ff0000' });# window 10
-$second = open_floating_window($x, { background_color => '#00ff00' }); # window 11
-$third = open_floating_window($x, { background_color => '#0000ff' }); # window 12
+$first = open_floating_window({ background_color => '#ff0000' });# window 10
+$second = open_floating_window({ background_color => '#00ff00' }); # window 11
+$third = open_floating_window({ background_color => '#0000ff' }); # window 12
sync_with_i3($x);
ok(workspace_exists($tmp), "workspace $tmp exists");
# Create a floating window which is smaller than the minimum enforced size of i3
-my $window = open_floating_window($x);
+my $window = open_floating_window;
ok($window->mapped, 'Window is mapped');
# switch to a different workspace, see if the window is still mapped?
#############################################################################
# Create a floating window which is smaller than the minimum enforced size of i3
-my $window = open_floating_window($x);
+my $window = open_floating_window;
ok($window->mapped, 'Window is mapped');
# switch to a different workspace, see if the window is still mapped?
#############################################################################
# Create a floating window
-my $window = open_floating_window($x);
+my $window = open_floating_window;
ok($window->mapped, 'Window is mapped');
my $ws = get_ws($tmp);
is(@{$ws->{nodes}}, 1, 'one tiling node (stacked con)');
# Create a floating window
-$window = open_floating_window($x);
+$window = open_floating_window;
ok($window->mapped, 'Window is mapped');
$ws = get_ws($tmp);
#############################################################################
# Create a floating window
-my $window = open_floating_window($x);
+my $window = open_floating_window;
ok($window->mapped, 'Window is mapped');
($nodes, $focus) = get_ws_content($tmp);
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
-$first = open_floating_window($x);
+$first = open_floating_window;
my $wscontent = get_ws($tmp);
my @floating = @{$wscontent->{floating_nodes}};
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
-$first = open_floating_window($x);
+$first = open_floating_window;
$wscontent = get_ws($tmp);
@floating = @{$wscontent->{floating_nodes}};