]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/112-floating-resize.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 112-floating-resize.t
index a428df4f8b92a58317b653fc16e013660d85ad9d..52817d709d0ed8784cfcb98ac51d6a8de41c0612 100644 (file)
@@ -9,13 +9,13 @@ fresh_workspace;
 # 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;
 $window->rect(X11::XCB::Rect->new(x => $a->x, y => $a->y, width => $a->width, height => $a->height));
 
-sync_with_i3($x);
+sync_with_i3;
 
 my ($na, $nt) = $window->rect;
 is_deeply($na, $a, 'Rects are equal after configurerequest');
@@ -23,7 +23,7 @@ is_deeply($na, $a, 'Rects are equal after configurerequest');
 sub test_resize {
     $window->rect(X11::XCB::Rect->new(x => 0, y => 0, width => 100, height => 100));
 
-    sync_with_i3($x);
+    sync_with_i3;
 
     my ($absolute, $top) = $window->rect;
 
@@ -34,7 +34,7 @@ sub test_resize {
 
     $window->rect(X11::XCB::Rect->new(x => 0, y => 0, width => 300, height => 500));
 
-    sync_with_i3($x);
+    sync_with_i3;
 
     ($absolute, $top) = $window->rect;
 
@@ -55,4 +55,22 @@ cmd 'border 1pixel';
 
 test_resize;
 
+################################################################################
+# Check if we can position a floating window out of bounds. The XDummy screen
+# is 1280x1024, so x=2864, y=893 is out of bounds.
+################################################################################
+
+($a, $t) = $window->rect;
+$window->rect(X11::XCB::Rect->new(
+    x => 2864,
+    y => 893,
+    width => $a->width,
+    height => $a->height));
+
+sync_with_i3;
+
+($a, $t) = $window->rect;
+cmp_ok($a->x, '<', 1280, 'X not moved out of bounds');
+cmp_ok($a->y, '<', 1024, 'Y not moved out of bounds');
+
 done_testing;