decorations: add Decorate/Undecorate actions

This commit is contained in:
Tobias Bengfort 2024-04-18 15:53:10 +02:00
parent d5f39c2ea0
commit c9fc9e566a
2 changed files with 20 additions and 0 deletions

View file

@ -128,6 +128,12 @@ Actions are used in menus and keyboard/mouse bindings.
By disabling the theme configuration 'keepBorder' the first step
will be removed and the action only toggles between on and off.
*<action name="Decorate" />*
Enable decorations of focused window.
*<action name="Undecorate" />*
Disable decorations of focused window.
*<action name="ToggleFullscreen" />*
Toggle fullscreen state of focused window.

View file

@ -79,6 +79,8 @@ enum action_type {
ACTION_TYPE_MAXIMIZE,
ACTION_TYPE_TOGGLE_FULLSCREEN,
ACTION_TYPE_TOGGLE_DECORATIONS,
ACTION_TYPE_DECORATE,
ACTION_TYPE_UNDECORATE,
ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP,
ACTION_TYPE_TOGGLE_ALWAYS_ON_BOTTOM,
ACTION_TYPE_TOGGLE_OMNIPRESENT,
@ -132,6 +134,8 @@ const char *action_names[] = {
"Maximize",
"ToggleFullscreen",
"ToggleDecorations",
"Decorate",
"Undecorate",
"ToggleAlwaysOnTop",
"ToggleAlwaysOnBottom",
"ToggleOmnipresent",
@ -790,6 +794,16 @@ actions_run(struct view *activator, struct server *server,
view_toggle_decorations(view);
}
break;
case ACTION_TYPE_DECORATE:
if (view) {
view_set_decorations(view, LAB_SSD_MODE_FULL);
}
break;
case ACTION_TYPE_UNDECORATE:
if (view) {
view_set_decorations(view, LAB_SSD_MODE_NONE);
}
break;
case ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP:
if (view) {
view_toggle_always_on_top(view);