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 use X11::XCB::Connection;
12 my $x = X11::XCB::Connection->new;
14 #####################################################################
15 # 1: check that new windows start with 'normal' border unless configured
17 #####################################################################
21 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
24 my $process = launch_with_config($config);
26 my $tmp = fresh_workspace;
28 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
30 my $first = open_standard_window($x);
32 my @content = @{get_ws_content($tmp)};
33 ok(@content == 1, 'one container opened');
34 is($content[0]->{border}, 'normal', 'border normal by default');
36 exit_gracefully($process->pid);
38 #####################################################################
39 # 2: check that new tiling windows start with '1pixel' border when
41 #####################################################################
45 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
50 $process = launch_with_config($config);
52 $tmp = fresh_workspace;
54 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
56 $first = open_standard_window($x);
58 @content = @{get_ws_content($tmp)};
59 ok(@content == 1, 'one container opened');
60 is($content[0]->{border}, '1pixel', 'border normal by default');
62 exit_gracefully($process->pid);
64 #####################################################################
65 # 3: check that new floating windows start with 'normal' border unless
66 # configured otherwise
67 #####################################################################
71 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
74 $process = launch_with_config($config);
76 $tmp = fresh_workspace;
78 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
80 # Create a floating window which is smaller than the minimum enforced size of i3
81 $first = $x->root->create_child(
82 class => WINDOW_CLASS_INPUT_OUTPUT,
83 rect => [ 0, 0, 30, 30],
84 background_color => '#C0C0C0',
85 # replace the type with 'utility' as soon as the coercion works again in X11::XCB
86 window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
93 my $wscontent = get_ws($tmp);
94 my @floating = @{$wscontent->{floating_nodes}};
95 ok(@floating == 1, 'one floating container opened');
96 my $floatingcon = $floating[0];
97 is($floatingcon->{nodes}->[0]->{border}, 'normal', 'border normal by default');
99 exit_gracefully($process->pid);
101 #####################################################################
102 # 4: check that new floating windows start with '1pixel' border when
104 #####################################################################
107 # i3 config file (v4)
108 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
113 $process = launch_with_config($config);
115 $tmp = fresh_workspace;
117 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
119 # Create a floating window which is smaller than the minimum enforced size of i3
120 $first = $x->root->create_child(
121 class => WINDOW_CLASS_INPUT_OUTPUT,
122 rect => [ 0, 0, 30, 30],
123 background_color => '#C0C0C0',
124 # replace the type with 'utility' as soon as the coercion works again in X11::XCB
125 window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
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);