aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-07-16 13:15:35 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-07-16 13:15:35 +1000
commit5f0a4bb6a46cf359dd270e3c448ca1e112331f9d (patch)
treeb6f9df379c05b5a1bda6010c9e3bab5ef8f9dfb0 /sway/tree/view.c
parent560627437b536db490d7e4a3c6fb4282757a7327 (diff)
downloadsway-5f0a4bb6a46cf359dd270e3c448ca1e112331f9d.tar.xz
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) {
view->urgent_timer = NULL;
}
+ struct sway_container *parent;
+ struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
+
if (view->is_fullscreen) {
- struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
ws->sway_workspace->fullscreen = NULL;
- container_destroy(view->swayc);
+ parent = container_destroy(view->swayc);
arrange_windows(ws->parent);
} else {
struct sway_container *parent = container_destroy(view->swayc);
arrange_windows(parent);
}
+ if (parent->type >= C_WORKSPACE) { // if the workspace still exists
+ workspace_detect_urgent(ws);
+ }
transaction_commit_dirty();
view->surface = NULL;
}
@@ -1073,7 +1078,7 @@ void view_set_urgent(struct sway_view *view, bool enable) {
ipc_event_window(view->swayc, "urgent");
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
- ipc_event_workspace(NULL, ws, "urgent");
+ workspace_detect_urgent(ws);
}
bool view_is_urgent(struct sway_view *view) {