summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-08-03 09:56:46 +0100
committerLibravatar GitHub <noreply@github.com>2018-08-03 09:56:46 +0100
commitb49904dd7ebe00d2779a4278eca92d7a558dd03d (patch)
tree66221fabcc5fb7d5986936d52d56a757ea01909a
parentMerge pull request #2415 from RyanDwyer/fix-fullscreen-container-crash (diff)
parentFix crash when fullscreen view closes on inactive workspace (diff)
downloadsway-b49904dd7ebe00d2779a4278eca92d7a558dd03d.tar.gz
sway-b49904dd7ebe00d2779a4278eca92d7a558dd03d.tar.zst
sway-b49904dd7ebe00d2779a4278eca92d7a558dd03d.zip
Merge pull request #2414 from RyanDwyer/fix-inactive-fullscreen-crash
Fix crash when fullscreen view closes on inactive workspace
-rw-r--r--sway/tree/view.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 97318daa..78baa705 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -592,19 +592,18 @@ void view_unmap(struct sway_view *view) {
592 view->urgent_timer = NULL; 592 view->urgent_timer = NULL;
593 } 593 }
594 594
595 struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); 595 bool was_fullscreen = view->swayc->is_fullscreen;
596 596 struct sway_container *surviving_ancestor = container_destroy(view->swayc);
597 struct sway_container *parent; 597
598 if (container_is_fullscreen_or_child(view->swayc)) { 598 // If the workspace wasn't reaped
599 parent = container_destroy(view->swayc); 599 if (surviving_ancestor->type >= C_WORKSPACE) {
600 arrange_windows(ws->parent); 600 struct sway_container *ws = surviving_ancestor->type == C_WORKSPACE ?
601 } else { 601 surviving_ancestor :
602 parent = container_destroy(view->swayc); 602 container_parent(surviving_ancestor, C_WORKSPACE);
603 arrange_windows(parent); 603 arrange_windows(was_fullscreen ? ws : surviving_ancestor);
604 }
605 if (parent->type >= C_WORKSPACE) { // if the workspace still exists
606 workspace_detect_urgent(ws); 604 workspace_detect_urgent(ws);
607 } 605 }
606
608 transaction_commit_dirty(); 607 transaction_commit_dirty();
609 view->surface = NULL; 608 view->surface = NULL;
610} 609}