mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
Implement floating
This commit is contained in:
parent
1132efe42e
commit
1f2e399ade
21 changed files with 572 additions and 169 deletions
|
|
@ -65,7 +65,9 @@ struct sway_container *workspace_create(struct sway_container *output,
|
|||
return NULL;
|
||||
}
|
||||
swayws->swayc = workspace;
|
||||
swayws->floating = create_list();
|
||||
swayws->floating = container_create(C_CONTAINER);
|
||||
swayws->floating->parent = swayws->swayc;
|
||||
swayws->floating->reapable = false;
|
||||
workspace->sway_workspace = swayws;
|
||||
|
||||
container_add_child(output, workspace);
|
||||
|
|
@ -408,3 +410,16 @@ bool workspace_is_visible(struct sway_container *ws) {
|
|||
}
|
||||
return focus == ws;
|
||||
}
|
||||
|
||||
bool workspace_is_empty(struct sway_container *ws) {
|
||||
if (!sway_assert(ws->type == C_WORKSPACE, "Expected a workspace")) {
|
||||
return false;
|
||||
}
|
||||
if (ws->children->length) {
|
||||
return false;
|
||||
}
|
||||
if (ws->sway_workspace->floating->children->length) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue