action: add ToggleAlwaysOnBottom

This commit is contained in:
Johan Malm 2023-05-11 22:26:41 +01:00 committed by Johan Malm
parent 78aec7945c
commit 15cd093f2e
7 changed files with 45 additions and 4 deletions

View file

@ -627,6 +627,28 @@ view_toggle_always_on_top(struct view *view)
}
}
static bool
view_is_always_on_bottom(struct view *view)
{
assert(view);
return view->scene_tree->node.parent ==
view->server->view_tree_always_on_bottom;
}
void
view_toggle_always_on_bottom(struct view *view)
{
assert(view);
if (view_is_always_on_bottom(view)) {
view->workspace = view->server->workspace_current;
wlr_scene_node_reparent(&view->scene_tree->node,
view->workspace->tree);
} else {
wlr_scene_node_reparent(&view->scene_tree->node,
view->server->view_tree_always_on_bottom);
}
}
void
view_move_to_workspace(struct view *view, struct workspace *workspace)
{