decorations: add Decorate/Undecorate actions

This commit is contained in:
Tobias Bengfort 2024-04-18 15:53:10 +02:00
parent 38ac6c59d6
commit 06c4e65ac1
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 By disabling the theme configuration 'keepBorder' the first step
will be removed and the action only toggles between on and off. 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" />* *<action name="ToggleFullscreen" />*
Toggle fullscreen state of focused window. Toggle fullscreen state of focused window.

View file

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