aboutsummaryrefslogtreecommitdiff
path: root/sway/focus.c
diff options
context:
space:
mode:
authorZandr Martin <zandrmartin@users.noreply.github.com>2016-07-04 13:53:49 -0500
committerGitHub <noreply@github.com>2016-07-04 13:53:49 -0500
commite07b8c8d7cfaaf6667a766c9d42d59fc14e98872 (patch)
tree93c374e26425460bfa7ad1bc1528a1b9b5725a8e /sway/focus.c
parentf8a94f2f4b429c75940d7451d3e7d75dfd4b66d3 (diff)
parent33abcd9573155d36f8a40936d06a44704287a99b (diff)
Merge branch 'master' into get-tree-command
Diffstat (limited to 'sway/focus.c')
-rw-r--r--sway/focus.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sway/focus.c b/sway/focus.c
index 2219ab4a..1d21ac35 100644
--- a/sway/focus.c
+++ b/sway/focus.c
@@ -243,3 +243,22 @@ swayc_t *get_focused_float(swayc_t *ws) {
}
return NULL;
}
+
+swayc_t *get_focused_view_include_floating(swayc_t *parent) {
+ swayc_t *c = parent;
+ swayc_t *f = NULL;
+
+ while (c && c->type != C_VIEW) {
+ if (c->type == C_WORKSPACE && c->focused == NULL) {
+ return ((f = get_focused_float(c))) ? f : c;
+ }
+
+ c = c->focused;
+ }
+
+ if (c == NULL) {
+ c = swayc_active_workspace_for(parent);
+ }
+
+ return c;
+}