diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-02 15:37:56 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-05 18:01:43 +1000 |
commit | 4e0452fce3bfc96db6f6f2951794cbb26e75ccd7 (patch) | |
tree | dfc9d82c97b051ec1829f918829a1f3c852c5131 | |
parent | Fix output position issue (diff) | |
download | sway-4e0452fce3bfc96db6f6f2951794cbb26e75ccd7.tar.gz sway-4e0452fce3bfc96db6f6f2951794cbb26e75ccd7.tar.zst sway-4e0452fce3bfc96db6f6f2951794cbb26e75ccd7.zip |
Fix scratchpad related crashes
* Was crashing when a view was moved to the scratchpad (prev focus had
no parent).
* Was crashing when a hidden scratchpad view unmaps because it has no
workspace.
-rw-r--r-- | sway/input/seat.c | 5 | ||||
-rw-r--r-- | sway/tree/view.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 502ed5ac..92d9d7ec 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -618,7 +618,10 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node, | |||
618 | if (last_focus) { | 618 | if (last_focus) { |
619 | seat_send_unfocus(last_focus, seat); | 619 | seat_send_unfocus(last_focus, seat); |
620 | node_set_dirty(last_focus); | 620 | node_set_dirty(last_focus); |
621 | node_set_dirty(node_get_parent(last_focus)); | 621 | struct sway_node *parent = node_get_parent(last_focus); |
622 | if (parent) { | ||
623 | node_set_dirty(parent); | ||
624 | } | ||
622 | } | 625 | } |
623 | 626 | ||
624 | // Put the container parents on the focus stack, then the workspace, then | 627 | // Put the container parents on the focus stack, then the workspace, then |
diff --git a/sway/tree/view.c b/sway/tree/view.c index 1b8d5738..57851b16 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -560,11 +560,11 @@ void view_unmap(struct sway_view *view) { | |||
560 | container_begin_destroy(view->container); | 560 | container_begin_destroy(view->container); |
561 | if (parent) { | 561 | if (parent) { |
562 | container_reap_empty(parent); | 562 | container_reap_empty(parent); |
563 | } else { | 563 | } else if (ws) { |
564 | workspace_consider_destroy(ws); | 564 | workspace_consider_destroy(ws); |
565 | } | 565 | } |
566 | 566 | ||
567 | if (!ws->node.destroying) { | 567 | if (ws && !ws->node.destroying) { |
568 | arrange_workspace(ws); | 568 | arrange_workspace(ws); |
569 | workspace_detect_urgent(ws); | 569 | workspace_detect_urgent(ws); |
570 | } | 570 | } |