]> git.mdlowis.com Git - proto/labwc.git/commitdiff
action: add FitToOutput
authorJens Peters <jp7677@gmail.com>
Mon, 22 Jan 2024 21:56:18 +0000 (22:56 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 22 Jan 2024 22:27:08 +0000 (22:27 +0000)
src/action.c

index 8e12eeb6388b6006aece0b14d70d49512a7c23c1..e118790633dfcff99b6e03c79828b04251083b69 100644 (file)
@@ -98,6 +98,7 @@ enum action_type {
        ACTION_TYPE_TOGGLE_KEYBINDS,
        ACTION_TYPE_FOCUS_OUTPUT,
        ACTION_TYPE_MOVE_TO_OUTPUT,
+       ACTION_TYPE_FIT_TO_OUTPUT,
        ACTION_TYPE_IF,
        ACTION_TYPE_FOR_EACH,
        ACTION_TYPE_VIRTUAL_OUTPUT_ADD,
@@ -150,6 +151,7 @@ const char *action_names[] = {
        "ToggleKeybinds",
        "FocusOutput",
        "MoveToOutput",
+       "FitToOutput",
        "If",
        "ForEach",
        "VirtualOutputAdd",
@@ -930,6 +932,12 @@ actions_run(struct view *activator, struct server *server,
                        }
                        view_move_to_output(view, target);
                        break;
+               case ACTION_TYPE_FIT_TO_OUTPUT:
+                       if (!view) {
+                               break;
+                       }
+                       view_constrain_size_to_that_of_usable_area(view);
+                       break;
                case ACTION_TYPE_SNAP_TO_REGION:
                        if (!view) {
                                break;