summaryrefslogtreecommitdiff
path: root/sway/focus.c
diff options
context:
space:
mode:
authorZandr Martin <[email protected]>2016-07-03 12:11:21 -0500
committerZandr Martin <[email protected]>2016-07-03 12:11:21 -0500
commitd5e4fff34544deda97f9f7d26eb1cb391fcc86bf (patch)
treeb053d7c2e9cc7651991aea1254a6f1f5232aea7c /sway/focus.c
parentaced6daa198d22d32ead71eec097321fd2b279de (diff)
resize command updates (#713)
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;
+}