gri3-wm/testcases/t
Michael Stapelberg 4976fa3350 con_set_layout: always use the parent container, handle workspaces properly
Previously, in case 'layout stacked' (for example) had been called
interactively, con_set_layout would be called with focused->parent,
while with for_window, it’d be called on the actual matching container.

This difference in behavior was the cause for the inability to use
'for_window [class="XTerm"] layout tabbed', which now works \o/, but
more on that below.

The change also allows us to handle the case of the user selecting a
CT_WORKSPACE container properly, that is, by using the special case and
creating a new split container on the workspace which gets all the
contents, but a new layout.

Now, before you are enthusiastic about the change and try to use
for_window magic in your config file, keep in mind: The 'layout' command
acts on the parent split container. That is, when using a line such as
this one:

    for_window [class="XTerm"] layout tabbed

…and opening an XTerm when on a workspace with one single other window,
the whole workspace will be set tabbed (just as previously when you
opened an XTerm and sent 'layout tabbed' manually).

Therefore, to open XTerm in its own tabbed split container, you need to
split before:

    for_window [class="XTerm"] split v, layout tabbed

The comma here is important! It says that the second command should not
be treated as an entirely unrelated command, but it should also relate
the matching window (while it does work with a ';', that is prone to
race-conditions and should be avoided).

fixes #358
2012-09-05 00:22:38 +02:00
..
000-load-deps.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
001-tile.t testcases: use open_window everywhere 2011-11-23 20:33:44 +00:00
002-i3-sync.t testcases: drop sync_with_i3()s $x parameter, use global 2011-11-23 00:02:50 +00:00
003-ipc.t testcases: drop sync_with_i3()s $x parameter, use global 2011-11-23 00:02:50 +00:00
004-unmanaged.t testcases: use open_window everywhere 2011-11-23 20:33:44 +00:00
005-floating.t Merge branch 'master' into next 2012-01-21 14:22:29 +00:00
100-fullscreen.t Replace the old fullscreen container when requesting fullscreen 2012-04-08 17:53:37 +02:00
101-focus.t testcases: don't sync_with_i3() before $x->input_focus 2011-11-23 00:02:54 +00:00
102-dock.t testcases: drop sync_with_i3()s $x parameter, use global 2011-11-23 00:02:50 +00:00
103-move.t testcases: correctly enable lexical pragmata 2011-11-21 23:50:39 +00:00
104-focus-stack.t testcases: drop open_floating_window()s $x parameter, use global 2011-11-23 00:02:47 +00:00
105-stacking.t testcases: correctly enable lexical pragmata 2011-11-21 23:50:39 +00:00
111-goto.t Merge branch 'master' into next 2011-12-17 14:22:57 +00:00
112-floating-resize.t Merge branch 'master' into next 2011-12-17 17:16:39 +00:00
113-urgent.t Use gettimeofday() and struct timevals instead of time() 2012-02-21 13:38:49 +01:00
114-client-leader.t testcases: drop open_floating_window()s $x parameter, use global 2011-11-23 00:02:47 +00:00
115-ipc-workspaces.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
116-nestedcons.t Introduce splith/splitv layouts, remove orientation 2012-08-04 03:13:24 +02:00
117-workspace.t tests: Check that 'workspace number <number>' opens a new workspace 2012-05-09 20:33:11 +02:00
118-openkill.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
119-match.t tests: introduce is_num_children test 2012-09-04 22:24:13 +02:00
120-multiple-cmds.t Send proper error messages upon parser failures, use yajl for generating command replies 2012-05-02 22:01:50 +02:00
121-next-prev.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
122-split.t con_set_layout: always use the parent container, handle workspaces properly 2012-09-05 00:22:38 +02:00
124-move.t tests: introduce is_num_children test 2012-09-04 22:24:13 +02:00
126-regress-close.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
127-regress-floating-parent.t testcases: replace sleep with sync_with_i3 where appropiate 2011-11-23 20:33:44 +00:00
128-open-order.t testcases: correctly enable lexical pragmata 2011-11-21 23:50:39 +00:00
129-focus-after-close.t testcases: replace sleep with sync_with_i3 where appropiate 2011-11-23 20:33:44 +00:00
130-close-empty-split.t Get rid of references to level up/down. 2012-05-28 23:37:15 +02:00
131-stacking-order.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
132-move-workspace.t tests: introduce is_num_children test 2012-09-04 22:24:13 +02:00
133-size-hints.t testcases: drop sync_with_i3()s $x parameter, use global 2011-11-23 00:02:50 +00:00
134-invalid-command.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
135-floating-focus.t testcases: don't sync_with_i3() before $x->input_focus 2011-11-23 00:02:54 +00:00
136-floating-ws-empty.t Merge branch 'master' into next 2011-12-20 18:44:26 +00:00
137-floating-unmap.t testcases: drop sync_with_i3()s $x parameter, use global 2011-11-23 00:02:50 +00:00
138-floating-attach.t testcases: drop open_floating_window()s $x parameter, use global 2011-11-23 00:02:47 +00:00
139-ws-numbers.t testcases: use Test::More is_deeply, don't depend on Test::Deep 2011-11-23 00:02:57 +00:00
140-focus-lost.t testcases: use Test::More is_deeply, don't depend on Test::Deep 2011-11-23 00:02:57 +00:00
141-resize.t Merge branch 'master' into next 2012-08-22 16:02:02 +02:00
142-regress-move-floating.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
143-regress-floating-restart.t make in-place restarts use socket activation, too (for faster/less flaky tests) 2012-01-21 23:03:09 +00:00
144-regress-floating-resize.t testcases: t/144-*: use open_window instead of launching urxvt 2011-11-23 20:33:44 +00:00
145-flattening.t Introduce splith/splitv layouts, remove orientation 2012-08-04 03:13:24 +02:00
146-floating-reinsert.t testcases: drop open_floating_window()s $x parameter, use global 2011-11-23 00:02:47 +00:00
147-regress-floatingmove.t Get rid of references to level up/down. 2012-05-28 23:37:15 +02:00
148-regress-floatingmovews.t testcases: replace sleep with sync_with_i3 where appropiate 2011-11-23 20:33:44 +00:00
150-regress-dock-restart.t make in-place restarts use socket activation, too (for faster/less flaky tests) 2012-01-21 23:03:09 +00:00
151-regress-float-size.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
152-regress-level-up.t Get rid of references to level up/down. 2012-05-28 23:37:15 +02:00
153-floating-originalsize.t testcases: drop sync_with_i3()s $x parameter, use global 2011-11-23 00:02:50 +00:00
154-regress-multiple-dock.t testcases: drop open_window()s $x parameter, use global one instead 2011-11-21 23:51:04 +00:00
155-floating-split-size.t testcases: drop open_window()s $x parameter, use global one instead 2011-11-21 23:51:04 +00:00
156-fullscreen-focus.t Restrict "move to workspace" commands in fullscreen. 2012-06-03 16:24:53 +02:00
158-wm_take_focus.t t/158-wm_take_focus: use sync_with_i3 instead of a timeout 2012-02-21 14:37:55 +01:00
159-socketpaths.t tests: make t/159-socketpath more robust 2012-06-29 21:23:28 +02:00
161-regress-borders-restart.t make in-place restarts use socket activation, too (for faster/less flaky tests) 2012-01-21 23:03:09 +00:00
162-regress-dock-urgent.t testcases: use open_window everywhere 2011-11-23 20:33:44 +00:00
163-wm-state.t testcases: don't sync_with_i3() before $x->input_focus 2011-11-23 00:02:54 +00:00
164-kill-win-vs-client.t t/164-kill-win-vs-client: get rid of sleep()s 2012-02-21 14:28:37 +01:00
165-for_window.t testcases: always start i3 through i3test::launch_with_config 2011-12-04 14:14:20 +01:00
166-assign.t tests: t/166-assign.t: use wait_for_window 2012-06-29 23:20:46 +02:00
167-workspace_layout.t Merge branch 'master' into next 2012-02-07 17:41:36 -05:00
168-regress-fullscreen-restart.t make in-place restarts use socket activation, too (for faster/less flaky tests) 2012-01-21 23:03:09 +00:00
169-border-toggle.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
170-force_focus_wrapping.t testcases: always start i3 through i3test::launch_with_config 2011-12-04 14:14:20 +01:00
171-config-migrate.t i3-migrate-config-to-v4: use layout toggle split (Thanks eeemsi) 2012-08-04 12:46:37 +02:00
172-start-on-named-ws.t testcases: always start i3 through i3test::launch_with_config 2011-12-04 14:14:20 +01:00
173-get-marks.t Merge branch 'master' into next 2011-12-17 14:22:57 +00:00
173-regress-focus-assign.t tests: don’t wait for window map event in open_special 2012-02-21 13:40:53 +01:00
174-border-config.t testcases: always start i3 through i3test::launch_with_config 2011-12-04 14:14:20 +01:00
174-regress-focus-toggle.t tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00
175-startup-notification.t tests: introduce is_num_children test 2012-09-04 22:24:13 +02:00
176-workspace-baf.t testcase for the previous commit 2012-08-22 17:57:58 +02:00
177-bar-config.t handle the old bar color config syntax in a backwards-compatible way 2012-01-20 22:26:17 +00:00
178-regress-workspace-open.t Close empty workspaces if they're not visible. 2011-10-24 00:12:14 +01:00
179-regress-multiple-ws.t tests: introduce is_num_children test 2012-09-04 22:24:13 +02:00
180-fd-leaks.t tests: add t/180-fd-leaks to ensure i3 does not leak fds on exec 2011-11-20 10:52:21 +00:00
181-regress-float-border.t tests: add test for ticket #561 (floating window size when changing border) 2011-11-26 21:20:00 +00:00
182-regress-focus-dock.t Bugfix: Fix crash on '[class="i3bar"] focus' (+test) (Thanks f8l) 2011-11-26 22:17:34 +00:00
183-config-variables.t tests: add test for previous commit 2011-12-17 11:18:43 +00:00
184-regress-float-split-resize.t Bugfix: Fix floating resize for floating split containers (+test) 2011-12-18 15:18:20 +00:00
185-scratchpad.t make in-place restarts use socket activation, too (for faster/less flaky tests) 2012-01-21 23:03:09 +00:00
186-regress-assign-focus-parent.t tests: introduce is_num_children test 2012-09-04 22:24:13 +02:00
187-commands-parser.t Display i3-nagbar when commands lead to an error 2012-08-02 17:45:09 +02:00
188-regress-focus-restart.t make in-place restarts use socket activation, too (for faster/less flaky tests) 2012-01-21 23:03:09 +00:00
189-floating-constraints.t tests: add a testcase for the floating size constraints 2012-02-16 18:43:47 +00:00
190-scratchpad-diff-ws.t tests: introduce is_num_children test 2012-09-04 22:24:13 +02:00
191-resize-levels.t resizing: traverse containers up properly (+test) (Thanks oblique) 2012-07-22 21:37:26 +02:00
192-layout.t Introduce splith/splitv layouts, remove orientation 2012-08-04 03:13:24 +02:00
193-ipc-version.t ipc: implement GET_VERSION to find out the i3 version 2012-08-05 14:30:05 +02:00
194-regress-floating-size.t add testcase for previous bugfix (floating window size) 2012-08-12 00:36:44 +02:00
195-net-active-window.t Bugfix: only honor _NET_ACTIVE_WINDOW for visible windows (+test) (Thanks Tucos) 2012-08-12 16:08:53 +02:00
196-randr-output-names.t accept slashes in RandR output names (+test) (Thanks dbp) 2012-08-28 13:26:12 +02:00
500-multi-monitor.t Implement fake-outputs option (cmdline, cfg) for multi-monitor testing 2012-04-09 14:28:36 +02:00
501-scratchpad.t tests: introduce is_num_children test 2012-09-04 22:24:13 +02:00
502-focus-output.t tests: warp the pointer to in multi-monitor tests to avoid flaky tests 2012-04-09 14:48:57 +02:00
503-workspace.t tests: warp the pointer to in multi-monitor tests to avoid flaky tests 2012-04-09 14:48:57 +02:00
504-move-workspace-to-output.t tests: t/504: ensure cursor position 2012-06-29 23:21:32 +02:00
505-scratchpad-resolution.t tests: introduce is_num_children test 2012-09-04 22:24:13 +02:00