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 $process = launch_with_config($config);
24 my $tmp = fresh_workspace;
26 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
28 my $first = open_standard_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($process->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 $process = launch_with_config($config);
50 $tmp = fresh_workspace;
52 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
54 $first = open_standard_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($process->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 $process = launch_with_config($config);
74 $tmp = fresh_workspace;
76 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
78 # Create a floating window which is smaller than the minimum enforced size of i3
79 $first = $x->root->create_child(
80 class => WINDOW_CLASS_INPUT_OUTPUT,
81 rect => [ 0, 0, 30, 30],
82 background_color => '#C0C0C0',
83 # replace the type with 'utility' as soon as the coercion works again in X11::XCB
84 window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
85 event_mask => [ 'structure_notify' ],
92 my $wscontent = get_ws($tmp);
93 my @floating = @{$wscontent->{floating_nodes}};
94 ok(@floating == 1, 'one floating container opened');
95 my $floatingcon = $floating[0];
96 is($floatingcon->{nodes}->[0]->{border}, 'normal', 'border normal by default');
98 exit_gracefully($process->pid);
100 #####################################################################
101 # 4: check that new floating windows start with '1pixel' border when
103 #####################################################################
106 # i3 config file (v4)
107 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
112 $process = launch_with_config($config);
114 $tmp = fresh_workspace;
116 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
118 # Create a floating window which is smaller than the minimum enforced size of i3
119 $first = $x->root->create_child(
120 class => WINDOW_CLASS_INPUT_OUTPUT,
121 rect => [ 0, 0, 30, 30],
122 background_color => '#C0C0C0',
123 # replace the type with 'utility' as soon as the coercion works again in X11::XCB
124 window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
125 event_mask => [ 'structure_notify' ],
132 $wscontent = get_ws($tmp);
133 @floating = @{$wscontent->{floating_nodes}};
134 ok(@floating == 1, 'one floating container opened');
135 $floatingcon = $floating[0];
136 is($floatingcon->{nodes}->[0]->{border}, '1pixel', 'border normal by default');
138 exit_gracefully($process->pid);