diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-07-03 21:53:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-03 21:53:28 -0400 |
commit | b658b464ece28a21017e39f383bb4487a40816f9 (patch) | |
tree | 71f4098558a28738e81ed7f71137da889c24c808 /sway/focus.c | |
parent | 7144fb9fc3b3d3b45d23deaab6a10caf3216cca4 (diff) | |
parent | a7b94f1324a1f9b19aad5ebde15d8d3c4693b980 (diff) |
Merge pull request #732 from zandrmartin/set-size-command
Set size command
Diffstat (limited to 'sway/focus.c')
-rw-r--r-- | sway/focus.c | 19 |
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; +} |