Fix crash with moving container that is to be flattened
Same can happen with move_to_output_directed but it is not so easy to write a test about it. Fixes #3831
This commit is contained in:
@ -1508,9 +1508,11 @@ void cmd_move_direction(I3_CMD, const char *direction_str, long move_px) {
|
||||
}
|
||||
}
|
||||
|
||||
/* the move command should not disturb focus */
|
||||
if (focused != initially_focused)
|
||||
/* The move command should not disturb focus. con_exists is called because
|
||||
* tree_move calls tree_flatten. */
|
||||
if (focused != initially_focused && con_exists(initially_focused)) {
|
||||
con_activate(initially_focused);
|
||||
}
|
||||
|
||||
// XXX: default reply for now, make this a better reply
|
||||
ysuccess(true);
|
||||
|
@ -237,8 +237,8 @@ static void move_to_output_directed(Con *con, direction_t direction) {
|
||||
/* force re-painting the indicators */
|
||||
FREE(con->deco_render_params);
|
||||
|
||||
tree_flatten(croot);
|
||||
ipc_send_window_event("move", con);
|
||||
tree_flatten(croot);
|
||||
ewmh_update_wm_desktop();
|
||||
}
|
||||
|
||||
@ -384,7 +384,7 @@ end:
|
||||
/* force re-painting the indicators */
|
||||
FREE(con->deco_render_params);
|
||||
|
||||
tree_flatten(croot);
|
||||
ipc_send_window_event("move", con);
|
||||
tree_flatten(croot);
|
||||
ewmh_update_wm_desktop();
|
||||
}
|
||||
|
Reference in New Issue
Block a user