2 # vim:ts=4:sw=4:expandtab
4 # Tests the new_window and new_float config option.
7 use i3test i3_autostart => 0;
9 #####################################################################
10 # 1: check that new windows start with 'normal' border unless configured
12 #####################################################################
16 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
19 my $pid = launch_with_config($config);
21 my $tmp = fresh_workspace;
23 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
25 my $first = open_window;
27 my @content = @{get_ws_content($tmp)};
28 ok(@content == 1, 'one container opened');
29 is($content[0]->{border}, 'normal', 'border normal by default');
31 exit_gracefully($pid);
33 #####################################################################
34 # 2: check that new tiling windows start with '1pixel' border when
36 #####################################################################
40 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
45 $pid = launch_with_config($config);
47 $tmp = fresh_workspace;
49 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
53 @content = @{get_ws_content($tmp)};
54 ok(@content == 1, 'one container opened');
55 is($content[0]->{border}, '1pixel', 'border normal by default');
57 exit_gracefully($pid);
59 #####################################################################
60 # 3: check that new floating windows start with 'normal' border unless
61 # configured otherwise
62 #####################################################################
66 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
69 $pid = launch_with_config($config);
71 $tmp = fresh_workspace;
73 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
75 $first = open_floating_window;
77 my $wscontent = get_ws($tmp);
78 my @floating = @{$wscontent->{floating_nodes}};
79 ok(@floating == 1, 'one floating container opened');
80 my $floatingcon = $floating[0];
81 is($floatingcon->{nodes}->[0]->{border}, 'normal', 'border normal by default');
83 exit_gracefully($pid);
85 #####################################################################
86 # 4: check that new floating windows start with '1pixel' border when
88 #####################################################################
92 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
97 $pid = launch_with_config($config);
99 $tmp = fresh_workspace;
101 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
103 $first = open_floating_window;
105 $wscontent = get_ws($tmp);
106 @floating = @{$wscontent->{floating_nodes}};
107 ok(@floating == 1, 'one floating container opened');
108 $floatingcon = $floating[0];
109 is($floatingcon->{nodes}->[0]->{border}, '1pixel', 'border normal by default');
111 exit_gracefully($pid);