]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/253-multiple-net-wm-state-atoms.t
Remove trailing whitespace from Perl scripts
[i3/i3] / testcases / t / 253-multiple-net-wm-state-atoms.t
index bbd6c5214c5889ae2e2f9996a6652b868b229328..392beae1330e456dc00bc64ae3f20eed708db422 100644 (file)
@@ -2,13 +2,13 @@
 # vim:ts=4:sw=4:expandtab
 #
 # Please read the following documents before working on tests:
-# • http://build.i3wm.org/docs/testsuite.html
+# • https://build.i3wm.org/docs/testsuite.html
 #   (or docs/testsuite)
 #
-# • http://build.i3wm.org/docs/lib-i3test.html
+# • https://build.i3wm.org/docs/lib-i3test.html
 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
 #
-# • http://build.i3wm.org/docs/ipc.html
+# • https://build.i3wm.org/docs/ipc.html
 #   (or docs/ipc)
 #
 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
@@ -21,19 +21,19 @@ use X11::XCB qw(:all);
 sub get_wm_state {
     sync_with_i3;
 
-    my ($con) = @_; 
+    my ($con) = @_;
     my $cookie = $x->get_property(
-        0,  
+        0,
         $con->{id},
         $x->atom(name => '_NET_WM_STATE')->id,
         GET_PROPERTY_TYPE_ANY,
-        0,  
+        0,
         4096
-    );  
+    );
 
     my $reply = $x->get_property_reply($cookie->{sequence});
     my $len = $reply->{length};
-    return 0 if $len == 0;
+    return undef if $len == 0;
 
     my @atoms = unpack("L$len", $reply->{value});
     return \@atoms;
@@ -64,6 +64,20 @@ cmd 'sticky enable';
 cmd 'fullscreen disable';
 is_deeply(get_wm_state($window), [ $wm_state_sticky ], 'only _NET_WM_STATE_STICKY is set');
 
+###############################################################################
+# _NET_WM_STATE is removed when the window is withdrawn.
+###############################################################################
+
+fresh_workspace;
+$window = open_window;
+cmd 'sticky enable';
+is_deeply(get_wm_state($window), [ $wm_state_sticky ], 'sanity check: _NET_WM_STATE_STICKY is set');
+
+$window->unmap;
+wait_for_unmap($window);
+
+is(get_wm_state($window), undef, '_NET_WM_STATE is removed');
+
 ##########################################################################
 
 done_testing;