diff options
author | emersion <contact@emersion.fr> | 2018-11-28 19:16:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-28 19:16:01 +0100 |
commit | 9924d72ab2c7a1202f8590f65377de23e8e39522 (patch) | |
tree | b90cff077e3d5ad98edd5561947342cd5c08bd13 /sway/tree | |
parent | 67c7cc53ae1d652a1ccb6375e243e3cfca37aa4e (diff) | |
parent | f52277f66e85d13589b51a851b9e97c3457ed654 (diff) | |
download | sway-9924d72ab2c7a1202f8590f65377de23e8e39522.tar.xz |
Merge pull request #3213 from RedSoxFan/fix-3203
Fix scratchpad segfault - NULL focused workspace
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/root.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c index 9f6bf607..22c46aba 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c @@ -69,13 +69,16 @@ void root_scratchpad_add_container(struct sway_container *con) { list_add(root->scratchpad, con); struct sway_seat *seat = input_manager_current_seat(); + struct sway_node *new_focus = NULL; if (parent) { arrange_container(parent); - seat_set_focus(seat, seat_get_focus_inactive(seat, &parent->node)); - } else { + new_focus = seat_get_focus_inactive(seat, &parent->node); + } + if (!new_focus) { arrange_workspace(workspace); - seat_set_focus(seat, seat_get_focus_inactive(seat, &workspace->node)); + new_focus = seat_get_focus_inactive(seat, &workspace->node); } + seat_set_focus(seat, new_focus); ipc_event_window(con, "move"); } |