Merge pull request #3835 from orestisfl/tree_flatten_crash
Fix crash with moving container that is to be flattened
This commit is contained in:
commit
6011e245e9
|
@ -1508,9 +1508,11 @@ void cmd_move_direction(I3_CMD, const char *direction_str, long move_px) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the move command should not disturb focus */
|
/* The move command should not disturb focus. con_exists is called because
|
||||||
if (focused != initially_focused)
|
* tree_move calls tree_flatten. */
|
||||||
|
if (focused != initially_focused && con_exists(initially_focused)) {
|
||||||
con_activate(initially_focused);
|
con_activate(initially_focused);
|
||||||
|
}
|
||||||
|
|
||||||
// XXX: default reply for now, make this a better reply
|
// XXX: default reply for now, make this a better reply
|
||||||
ysuccess(true);
|
ysuccess(true);
|
||||||
|
|
|
@ -237,8 +237,8 @@ static void move_to_output_directed(Con *con, direction_t direction) {
|
||||||
/* force re-painting the indicators */
|
/* force re-painting the indicators */
|
||||||
FREE(con->deco_render_params);
|
FREE(con->deco_render_params);
|
||||||
|
|
||||||
tree_flatten(croot);
|
|
||||||
ipc_send_window_event("move", con);
|
ipc_send_window_event("move", con);
|
||||||
|
tree_flatten(croot);
|
||||||
ewmh_update_wm_desktop();
|
ewmh_update_wm_desktop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ end:
|
||||||
/* force re-painting the indicators */
|
/* force re-painting the indicators */
|
||||||
FREE(con->deco_render_params);
|
FREE(con->deco_render_params);
|
||||||
|
|
||||||
tree_flatten(croot);
|
|
||||||
ipc_send_window_event("move", con);
|
ipc_send_window_event("move", con);
|
||||||
|
tree_flatten(croot);
|
||||||
ewmh_update_wm_desktop();
|
ewmh_update_wm_desktop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
#!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)
|
||||||
|
#
|
||||||
|
# Test that moving a container that is to be flattened does not crash i3
|
||||||
|
# Ticket: #3831
|
||||||
|
# Bug still in: 4.17-199-ga638e0408
|
||||||
|
use i3test;
|
||||||
|
|
||||||
|
cmp_tree(
|
||||||
|
msg => 'Moving a redundant container that is to be flattened does not crash i3',
|
||||||
|
layout_before => 'a H[V[b* c]]', # Not very attached to this result but
|
||||||
|
layout_after => 'H[a] b* c', # mainly checking if the crash happens.
|
||||||
|
cb => sub {
|
||||||
|
cmd 'focus parent, focus parent, move down';
|
||||||
|
does_i3_live;
|
||||||
|
is(get_ws(focused_ws)->{layout}, 'splitv', 'Workspace changed to splitv');
|
||||||
|
});
|
||||||
|
|
||||||
|
cmp_tree(
|
||||||
|
msg => "Same but create the redundant container with a 'split h' command",
|
||||||
|
layout_before => 'a V[b* c]',
|
||||||
|
layout_after => 'H[a] b* c',
|
||||||
|
cb => sub {
|
||||||
|
cmd 'focus parent, split h, focus parent, move down';
|
||||||
|
does_i3_live;
|
||||||
|
is(get_ws(focused_ws)->{layout}, 'splitv', 'Workspace changed to splitv');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
done_testing;
|
Loading…
Reference in New Issue