Add RaiseLower action

This commit is contained in:
Johan Malm 2023-09-28 21:06:20 +01:00
parent e5aef03319
commit b6aa0ce9b0
2 changed files with 15 additions and 0 deletions

View file

@ -33,6 +33,10 @@ Actions are used in menus and keyboard/mouse bindings.
*<action name="Lower" />*
Restack the current window below other open windows.
*<action name="RaiseLower" />*
Raise the window if it is currently behind any other windows. Lower the
window it is above all other windows.
*<action name="Iconify" />*
Iconify (minimize) focused window.

View file

@ -73,6 +73,7 @@ enum action_type {
ACTION_TYPE_MOVE,
ACTION_TYPE_RAISE,
ACTION_TYPE_LOWER,
ACTION_TYPE_RAISELOWER,
ACTION_TYPE_RESIZE,
ACTION_TYPE_RESIZE_RELATIVE,
ACTION_TYPE_MOVETO,
@ -109,6 +110,7 @@ const char *action_names[] = {
"Move",
"Raise",
"Lower",
"RaiseLower",
"Resize",
"ResizeRelative",
"MoveTo",
@ -657,6 +659,15 @@ actions_run(struct view *activator, struct server *server,
view_move_to_back(view);
}
break;
case ACTION_TYPE_RAISELOWER:
if (view) {
if (view == view->server->focused_view) {
view_move_to_back(view);
} else {
view_move_to_front(view);
}
}
break;
case ACTION_TYPE_RESIZE:
if (view) {
interactive_begin(view, LAB_INPUT_STATE_RESIZE,