aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-16 13:15:35 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-16 13:15:35 +1000
commit5f0a4bb6a46cf359dd270e3c448ca1e112331f9d (patch)
treeb6f9df379c05b5a1bda6010c9e3bab5ef8f9dfb0 /sway/tree/view.c
parentMake container_for_each_descendant_dfs descend into floating views (diff)
downloadsway-5f0a4bb6a46cf359dd270e3c448ca1e112331f9d.tar.gz
sway-5f0a4bb6a46cf359dd270e3c448ca1e112331f9d.tar.zst
sway-5f0a4bb6a46cf359dd270e3c448ca1e112331f9d.zip
Update workspace urgent state when views close or move workspaces
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index ae520b07..b5b73408 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -595,16 +595,21 @@ void view_unmap(struct sway_view *view) {
595 view->urgent_timer = NULL; 595 view->urgent_timer = NULL;
596 } 596 }
597 597
598 struct sway_container *parent;
599 struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
600
598 if (view->is_fullscreen) { 601 if (view->is_fullscreen) {
599 struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
600 ws->sway_workspace->fullscreen = NULL; 602 ws->sway_workspace->fullscreen = NULL;
601 container_destroy(view->swayc); 603 parent = container_destroy(view->swayc);
602 604
603 arrange_windows(ws->parent); 605 arrange_windows(ws->parent);
604 } else { 606 } else {
605 struct sway_container *parent = container_destroy(view->swayc); 607 struct sway_container *parent = container_destroy(view->swayc);
606 arrange_windows(parent); 608 arrange_windows(parent);
607 } 609 }
610 if (parent->type >= C_WORKSPACE) { // if the workspace still exists
611 workspace_detect_urgent(ws);
612 }
608 transaction_commit_dirty(); 613 transaction_commit_dirty();
609 view->surface = NULL; 614 view->surface = NULL;
610} 615}
@@ -1073,7 +1078,7 @@ void view_set_urgent(struct sway_view *view, bool enable) {
1073 ipc_event_window(view->swayc, "urgent"); 1078 ipc_event_window(view->swayc, "urgent");
1074 1079
1075 struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); 1080 struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
1076 ipc_event_workspace(NULL, ws, "urgent"); 1081 workspace_detect_urgent(ws);
1077} 1082}
1078 1083
1079bool view_is_urgent(struct sway_view *view) { 1084bool view_is_urgent(struct sway_view *view) {