diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-15 22:43:33 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-16 08:19:25 +1000 |
commit | 315d5311b2004b9e148e7b52a7de161b6dfe3878 (patch) | |
tree | 1a70d1d73cbffb26bf432c1c7b395ee996651ad3 /sway/tree/workspace.c | |
parent | Merge pull request #2280 from ianyfan/leaks (diff) | |
download | sway-315d5311b2004b9e148e7b52a7de161b6dfe3878.tar.gz sway-315d5311b2004b9e148e7b52a7de161b6dfe3878.tar.zst sway-315d5311b2004b9e148e7b52a7de161b6dfe3878.zip |
Implement urgency base functionality
Introduces a command to manually set urgency, as well as rendering of
urgent views, sending the IPC event, removing urgency after focused for
one second, and matching urgent views via criteria.
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r-- | sway/tree/workspace.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 2a2d834a..d71b0a53 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "sway/ipc-server.h" | 11 | #include "sway/ipc-server.h" |
12 | #include "sway/tree/arrange.h" | 12 | #include "sway/tree/arrange.h" |
13 | #include "sway/tree/container.h" | 13 | #include "sway/tree/container.h" |
14 | #include "sway/tree/view.h" | ||
14 | #include "sway/tree/workspace.h" | 15 | #include "sway/tree/workspace.h" |
15 | #include "list.h" | 16 | #include "list.h" |
16 | #include "log.h" | 17 | #include "log.h" |
@@ -518,3 +519,12 @@ struct sway_container *workspace_output_get_highest_available( | |||
518 | 519 | ||
519 | return NULL; | 520 | return NULL; |
520 | } | 521 | } |
522 | |||
523 | static bool find_urgent_iterator(struct sway_container *con, | ||
524 | void *data) { | ||
525 | return con->type == C_VIEW && view_is_urgent(con->sway_view); | ||
526 | } | ||
527 | |||
528 | bool workspace_is_urgent(struct sway_container *workspace) { | ||
529 | return container_find(workspace, find_urgent_iterator, NULL); | ||
530 | } | ||