From: Ingo Bürk Date: Sat, 18 Apr 2015 22:30:01 +0000 (+0200) Subject: Added testcase for changing _NET_WM_WINDOW_TYPE after the window is already managed. X-Git-Tag: 4.11~123^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=18c45a7f098a05549c2ab3dd12d42c77771d1064;p=i3%2Fi3 Added testcase for changing _NET_WM_WINDOW_TYPE after the window is already managed. --- diff --git a/testcases/t/165-for_window.t b/testcases/t/165-for_window.t index 036fc9d6..a7629d63 100644 --- a/testcases/t/165-for_window.t +++ b/testcases/t/165-for_window.t @@ -408,6 +408,39 @@ EOT } +############################################################## +# 11: check that the criterion 'window_type' works if the +# _NET_WM_WINDOW_TYPE is changed after managing. +############################################################## + +while (my ($window_type, $atom) = each %window_types) { + + $config = <<"EOT"; +# i3 config file (v4) +font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 +for_window [window_type="$window_type"] floating enable, mark branded +EOT + + $pid = launch_with_config($config); + $tmp = fresh_workspace; + + $window = open_window(); + + my $atomname = $x->atom(name => '_NET_WM_WINDOW_TYPE'); + my $atomtype = $x->atom(name => 'ATOM'); + $x->change_property(PROP_MODE_REPLACE, $window->id, $atomname->id, $atomtype->id, + 32, 1, pack('L1', $x->atom(name => $atom)->id)); + $x->flush; + sync_with_i3; + + my @nodes = @{get_ws($tmp)->{floating_nodes}}; + cmp_ok(@nodes, '==', 1, 'one floating container on this workspace'); + is($nodes[0]->{nodes}[0]->{mark}, 'branded', "mark set (window_type = $atom)"); + + exit_gracefully($pid); + +} + ############################################################## done_testing;