]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/action.c: fix MoveToOutput action by renaming 'name' argument
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 6 Mar 2024 03:30:17 +0000 (04:30 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 6 Mar 2024 18:34:56 +0000 (18:34 +0000)
We were using the argument name 'name' before
which is already used by the action itself:
`<action name="MoveToOutput" name="HDMI-A-1" />`

Change the argument name to "output" which also
matches the `FocusOutput` action.

Fixes: #1589
Reported-by: @bnason (thanks!)
docs/labwc-actions.5.scd
src/action.c

index facb2d68fb10a82807c20153ce2dbf0ea0948664..9236567e96a56a92ff1ee541c98195f85c9936b4 100644 (file)
@@ -163,12 +163,12 @@ Actions are used in menus and keyboard/mouse bindings.
        to the center of the window. If the given output does not contain
        any windows, the cursor is centered on the given output.
 
-*<action name="MoveToOutput" name="HDMI-A-1" direction="value" wrap="no" />*
+*<action name="MoveToOutput" output="HDMI-A-1" direction="value" wrap="no" />*
        Moves active window to other output, unless the window state is
        fullscreen.
 
-       If *name* is specified, the window will be sent directly to the specified
-       output and *direction* is ignored. If *name* is omitted, *direction* may
+       If *output* is specified, the window will be sent directly to the specified
+       output and *direction* is ignored. If *output* is omitted, *direction* may
        be one of "left", "right", "up" or "down" to indicate that the window
        should be moved to the next output in that direction (if one exists). 
 
index 1cf8960a3f2bc4cc086515f03f9ef9d124ebd180..8e152c796b7a5aededb4e362818a84064063b004 100644 (file)
@@ -383,7 +383,7 @@ action_arg_from_xml_node(struct action *action, const char *nodename, const char
                }
                break;
        case ACTION_TYPE_MOVE_TO_OUTPUT:
-               if (!strcmp(argument, "name")) {
+               if (!strcmp(argument, "output")) {
                        action_arg_add_str(action, argument, content);
                        goto cleanup;
                }
@@ -921,10 +921,10 @@ actions_run(struct view *activator, struct server *server,
                        if (!view) {
                                break;
                        }
-                       const char *name = action_get_str(action, "name", NULL);
+                       const char *output_name = action_get_str(action, "output", NULL);
                        struct output *target = NULL;
-                       if (name) {
-                               target = output_from_name(view->server, name);
+                       if (output_name) {
+                               target = output_from_name(view->server, output_name);
                        } else {
                                /* Config parsing makes sure that direction is a valid direction */
                                enum view_edge edge = action_get_int(action, "direction", 0);