Add keepBorder <theme> option and enable it by default

With the new keepBorder option enabled, the
ToggleDecorations action now has 3 states:

- the first time only disables the titlebar
- the second time disables the whole SSD
- the third time enables the whole SSD again

When the keepBorder action is disabled, the old 2-state
behavior is restored, e.g. the ToggleDecorations action
only toggles between on and off.

Fixes #813
This commit is contained in:
Consolatis 2023-04-14 09:01:13 +02:00
parent a6a03daae3
commit e39744f1d3
13 changed files with 91 additions and 10 deletions

View file

@ -34,9 +34,11 @@ ssd_titlebar_create(struct ssd *ssd)
struct wlr_buffer *maximize_button_unpressed;
struct wlr_buffer *close_button_unpressed;
ssd->titlebar.tree = wlr_scene_tree_create(ssd->tree);
struct ssd_sub_tree *subtree;
FOR_EACH_STATE(ssd, subtree) {
subtree->tree = wlr_scene_tree_create(ssd->tree);
subtree->tree = wlr_scene_tree_create(ssd->titlebar.tree);
parent = subtree->tree;
wlr_scene_node_set_position(&parent->node, 0, -theme->title_height);
if (subtree == &ssd->titlebar.active) {
@ -138,7 +140,7 @@ ssd_titlebar_update(struct ssd *ssd)
void
ssd_titlebar_destroy(struct ssd *ssd)
{
if (!ssd->titlebar.active.tree) {
if (!ssd->titlebar.tree) {
return;
}
@ -153,6 +155,9 @@ ssd_titlebar_destroy(struct ssd *ssd)
free(ssd->state.title.text);
ssd->state.title.text = NULL;
}
wlr_scene_node_destroy(&ssd->titlebar.tree->node);
ssd->titlebar.tree = NULL;
}
/*