2 # vim:ts=4:sw=4:expandtab
3 # !NO_I3_INSTANCE! will prevent complete-run.pl from starting i3
5 # Tests the new_window and new_float config option.
10 my $x = X11::XCB::Connection->new;
12 #####################################################################
13 # 1: check that new windows start with 'normal' border unless configured
15 #####################################################################
19 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
22 my $pid = launch_with_config($config);
24 my $tmp = fresh_workspace;
26 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
28 my $first = open_window($x);
30 my @content = @{get_ws_content($tmp)};
31 ok(@content == 1, 'one container opened');
32 is($content[0]->{border}, 'normal', 'border normal by default');
34 exit_gracefully($pid);
36 #####################################################################
37 # 2: check that new tiling windows start with '1pixel' border when
39 #####################################################################
43 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
48 $pid = launch_with_config($config);
50 $tmp = fresh_workspace;
52 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
54 $first = open_window($x);
56 @content = @{get_ws_content($tmp)};
57 ok(@content == 1, 'one container opened');
58 is($content[0]->{border}, '1pixel', 'border normal by default');
60 exit_gracefully($pid);
62 #####################################################################
63 # 3: check that new floating windows start with 'normal' border unless
64 # configured otherwise
65 #####################################################################
69 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
72 $pid = launch_with_config($config);
74 $tmp = fresh_workspace;
76 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
78 $first = open_floating_window($x);
80 my $wscontent = get_ws($tmp);
81 my @floating = @{$wscontent->{floating_nodes}};
82 ok(@floating == 1, 'one floating container opened');
83 my $floatingcon = $floating[0];
84 is($floatingcon->{nodes}->[0]->{border}, 'normal', 'border normal by default');
86 exit_gracefully($pid);
88 #####################################################################
89 # 4: check that new floating windows start with '1pixel' border when
91 #####################################################################
95 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
100 $pid = launch_with_config($config);
102 $tmp = fresh_workspace;
104 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
106 $first = open_floating_window($x);
108 $wscontent = get_ws($tmp);
109 @floating = @{$wscontent->{floating_nodes}};
110 ok(@floating == 1, 'one floating container opened');
111 $floatingcon = $floating[0];
112 is($floatingcon->{nodes}->[0]->{border}, '1pixel', 'border normal by default');
114 exit_gracefully($pid);