- Add routine that will refocus the expected window on test failure.
Thus, failure on one test will not make others fail.
- Remove some redundant commands, prefer fresh_workspace for screen
changing.
- Kill previous windows between sections if the next section does not
depend on the previous layout.
con_detach and con_attach modify the focus stack.
This will make sure that the currently focused workspace will remain
focused after disabling an output.
This fixes a crash produced with the following config:
# i3 config file (v4)
workspace 1 output $screen1
workspace 2 output $screen2
exec --no-startup-id "i3-msg workspace 1, open && i3-msg workspace 2 && xrandr --output $screen2 --off && xrandr --output $screen1 --auto --output $screen2 --auto --right-of $screen1 "
Which results in:
ERROR: AddressSanitizer: heap-use-after-free on address …
READ of size 8 at 0x614000001f48 thread T0
#0 0x5563df6e73a8 in init_ws_for_output i3/src/randr.c:468
#1 0x5563df6ef3b4 in randr_query_outputs i3/src/randr.c:940
#2 0x5563df68dbe1 in handle_screen_change i3/src/handlers.c:450
… is located 264 bytes inside of 448-byte region …
freed by thread T0 here:
#1 0x5563df634b0a in con_free i3/src/con.c:96
#2 0x5563df7151e6 in tree_close_internal i3/src/tree.c:344
#3 0x5563df7280fe in workspace_show i3/src/workspace.c:499
#4 0x5563df6e7315 in init_ws_for_output i3/src/randr.c:457
#5 0x5563df6ef3b4 in randr_query_outputs i3/src/randr.c:940
#6 0x5563df68dbe1 in handle_screen_change i3/src/handlers.c:450
Which is similar to #3228, #3248.
- Improve / add various error messages.
- Replace all `LOG(…); ysuccess(false);` with `yerror(…);`.
- switch_mode: Remove redundant "ERROR:" ELOG string.
- cmd_move_con_to_workspace*: Make sure that we don't try to move an
empty workspace to another workspace. This can be problematic when we
match a workspace using command criteria (eg marks) and the target is a
non-existing workspace. We create the new workspace but since nothing is
moved there, we are left with an empty workspace. See added testcase.
Modified section on the layout file's non-compliance with the JSON
standard. The section previously stated that having multiple top-level
JSON texts is non-compliant. This isn't the case. It's just that most
JSON parsers will treat that as if it is non-compliant.
Fixes#3156.
I couldn't reproduce the problem in a "natural" way so I cheated:
1. Start i3 with gdb
2. Set breakpoing on tree_restore
3. Run, open window, i3-msg restart
5. Open the file in *path with a hex editor
6. Edit the "name" field of the window and insert bytes that are not
valid UTF8
7. Continue
After parsing fails, all nodes including croot are incomplete, meaning
they have to be deleted. We can't recover in any reasonable way so we
have to allow non-UTF8 characters to avoid this situation altogether.
The default i3 config uses the `exec` command without `--no-startup-id`
to launch:
1. i3-nagbar
4cba9fcbda/etc/config (L150)
2. i3-config-wizard
4cba9fcbda/etc/config (L194)
A user that opens i3 for the first time will be greeted with a "loading"
cursor because of i3-config-wizard.
Introduces resize_neighboring_cons in resize.c which is also used by
resize_graphical_handler.
Co-authored-by: Andrew Laucius <andrewla@gmail.com>
Authored original code and tests in #3240. I rewrote most of the
resizing code and fixed the failing tests.