resize command updates (#713)

This commit is contained in:
Zandr Martin 2016-07-03 12:11:21 -05:00
parent aced6daa19
commit d5e4fff345
No known key found for this signature in database
GPG key ID: AA2BB8EF77F7BBDC
6 changed files with 229 additions and 52 deletions

View file

@ -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;
}