summaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2018-07-16 15:39:08 -0700
committerGitHub <[email protected]>2018-07-16 15:39:08 -0700
commitd6bd314dffb7385eec73de40f0fdd5775cd5941b (patch)
tree1cec389e971cda3e42766c07789d0f51c2d39715 /sway/tree/container.c
parent297e32126f1f8b27f51989b863e4ea1c9fce6a96 (diff)
parent255dc8bbb040c4f268f318bde86701227d82da3f (diff)
Merge pull request #2276 from RyanDwyer/urgency
Implement urgency base functionality
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 35f67cce..6d52c38c 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -674,16 +674,23 @@ struct sway_container *floating_container_at(double lx, double ly,
void container_for_each_descendant_dfs(struct sway_container *container,
void (*f)(struct sway_container *container, void *data),
void *data) {
- if (container) {
- if (container->children) {
- for (int i = 0; i < container->children->length; ++i) {
- struct sway_container *child =
- container->children->items[i];
- container_for_each_descendant_dfs(child, f, data);
- }
+ if (!container) {
+ return;
+ }
+ if (container->children) {
+ for (int i = 0; i < container->children->length; ++i) {
+ struct sway_container *child = container->children->items[i];
+ container_for_each_descendant_dfs(child, f, data);
+ }
+ }
+ if (container->type == C_WORKSPACE) {
+ struct sway_container *floating = container->sway_workspace->floating;
+ for (int i = 0; i < floating->children->length; ++i) {
+ struct sway_container *child = floating->children->items[i];
+ container_for_each_descendant_dfs(child, f, data);
}
- f(container, data);
}
+ f(container, data);
}
void container_for_each_descendant_bfs(struct sway_container *con,
@@ -1063,6 +1070,8 @@ void container_floating_move_to(struct sway_container *con,
container_add_child(new_workspace->sway_workspace->floating, con);
arrange_windows(old_workspace);
arrange_windows(new_workspace);
+ workspace_detect_urgent(old_workspace);
+ workspace_detect_urgent(new_workspace);
}
}
@@ -1073,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);
+}