From 9db03797da3cea5dc6898adc79a68ba4523a409c Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 20 Apr 2021 09:04:07 +0200 Subject: [PATCH] =?UTF-8?q?fix=20crash=20with=20=E2=80=9Clayout=20default?= =?UTF-8?q?=E2=80=9D:=20ipc.c=20won=E2=80=99t=20dump=20L=5FDEFAULT=20layou?= =?UTF-8?q?t=20(#4409)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #4408 --- src/con.c | 4 ++-- testcases/t/312-regress-layout-default.t | 25 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 testcases/t/312-regress-layout-default.t diff --git a/src/con.c b/src/con.c index 9f0eb7ad..b935bed6 100644 --- a/src/con.c +++ b/src/con.c @@ -1855,9 +1855,9 @@ void con_set_layout(Con *con, layout_t layout) { con_attach(new, con, false); tree_flatten(croot); + con_force_split_parents_redraw(con); + return; } - con_force_split_parents_redraw(con); - return; } if (layout == L_DEFAULT) { diff --git a/testcases/t/312-regress-layout-default.t b/testcases/t/312-regress-layout-default.t new file mode 100644 index 00000000..b23cf50b --- /dev/null +++ b/testcases/t/312-regress-layout-default.t @@ -0,0 +1,25 @@ +#!perl +# vim:ts=4:sw=4:expandtab +# +# Please read the following documents before working on tests: +# • https://build.i3wm.org/docs/testsuite.html +# (or docs/testsuite) +# +# • https://build.i3wm.org/docs/lib-i3test.html +# (alternatively: perldoc ./testcases/lib/i3test.pm) +# +# • https://build.i3wm.org/docs/ipc.html +# (or docs/ipc) +# +# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf +# (unless you are already familiar with Perl) +# +# Verifies i3 does not crash when using layout default. +# Ticket: #4408 +# Bug still in: 4.19.2-83-gc8158875 +use i3test; + +cmd 'layout default'; +fresh_workspace; + +done_testing;