diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-16 14:30:31 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-16 14:30:31 +1000 |
commit | be28c18ad5a3271aad537a5356662d57f16d9703 (patch) | |
tree | 3b83225ea6ccb895c7ac83e0f9f578317a88e3e0 /sway/tree | |
parent | 5f0a4bb6a46cf359dd270e3c448ca1e112331f9d (diff) |
Mark containers as urgent in IPC if they have urgent views
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 9 | ||||
-rw-r--r-- | sway/tree/workspace.c | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index c1de46b5..6d52c38c 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -1082,3 +1082,12 @@ void container_set_dirty(struct sway_container *container) { container->dirty = true; list_add(server.dirty_containers, container); } + +static bool find_urgent_iterator(struct sway_container *con, + void *data) { + return con->type == C_VIEW && view_is_urgent(con->sway_view); +} + +bool container_has_urgent_child(struct sway_container *container) { + return container_find(container, find_urgent_iterator, NULL); +} diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index d14f01eb..00b479ec 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -520,13 +520,8 @@ struct sway_container *workspace_output_get_highest_available( return NULL; } -static bool find_urgent_iterator(struct sway_container *con, - void *data) { - return con->type == C_VIEW && view_is_urgent(con->sway_view); -} - void workspace_detect_urgent(struct sway_container *workspace) { - bool new_urgent = container_find(workspace, find_urgent_iterator, NULL); + bool new_urgent = container_has_urgent_child(workspace); if (workspace->sway_workspace->urgent != new_urgent) { workspace->sway_workspace->urgent = new_urgent; |