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 | |
parent | Merge pull request #3206 from RedSoxFan/ipc-subscribe (diff) | |
parent | Fix scratchpad segfault - NULL focused workspace (diff) | |
download | sway-9924d72ab2c7a1202f8590f65377de23e8e39522.tar.gz sway-9924d72ab2c7a1202f8590f65377de23e8e39522.tar.zst sway-9924d72ab2c7a1202f8590f65377de23e8e39522.zip |
Merge pull request #3213 from RedSoxFan/fix-3203
Fix scratchpad segfault - NULL focused workspace
-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) { | |||
69 | list_add(root->scratchpad, con); | 69 | list_add(root->scratchpad, con); |
70 | 70 | ||
71 | struct sway_seat *seat = input_manager_current_seat(); | 71 | struct sway_seat *seat = input_manager_current_seat(); |
72 | struct sway_node *new_focus = NULL; | ||
72 | if (parent) { | 73 | if (parent) { |
73 | arrange_container(parent); | 74 | arrange_container(parent); |
74 | seat_set_focus(seat, seat_get_focus_inactive(seat, &parent->node)); | 75 | new_focus = seat_get_focus_inactive(seat, &parent->node); |
75 | } else { | 76 | } |
77 | if (!new_focus) { | ||
76 | arrange_workspace(workspace); | 78 | arrange_workspace(workspace); |
77 | seat_set_focus(seat, seat_get_focus_inactive(seat, &workspace->node)); | 79 | new_focus = seat_get_focus_inactive(seat, &workspace->node); |
78 | } | 80 | } |
81 | seat_set_focus(seat, new_focus); | ||
79 | 82 | ||
80 | ipc_event_window(con, "move"); | 83 | ipc_event_window(con, "move"); |
81 | } | 84 | } |