]> git.mdlowis.com Git - proto/labwc.git/commitdiff
actions: prevent users entering invalid direction=any value
authorlynxy <git@lynxdev.xyz>
Wed, 2 Jul 2025 22:39:32 +0000 (00:39 +0200)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Sat, 19 Jul 2025 03:29:55 +0000 (12:29 +0900)
src/action.c

index a88ce309bfdd90ab1e473a843584a2a28b82d79d..6df6897933ee7c0d9c24bac59acba169537974c5 100644 (file)
@@ -344,7 +344,7 @@ action_arg_from_xml_node(struct action *action, const char *nodename, const char
                        bool allow_center = action->type == ACTION_TYPE_TOGGLE_SNAP_TO_EDGE
                                || action->type == ACTION_TYPE_SNAP_TO_EDGE;
                        if ((edge == VIEW_EDGE_CENTER && !allow_center)
-                                       || edge == VIEW_EDGE_INVALID) {
+                                       || edge == VIEW_EDGE_INVALID || edge == VIEW_EDGE_ALL) {
                                wlr_log(WLR_ERROR, "Invalid argument for action %s: '%s' (%s)",
                                        action_names[action->type], argument, content);
                        } else {
@@ -452,7 +452,7 @@ action_arg_from_xml_node(struct action *action, const char *nodename, const char
                }
                if (!strcmp(argument, "direction")) {
                        enum view_edge edge = view_edge_parse(content);
-                       if (edge == VIEW_EDGE_CENTER) {
+                       if (edge == VIEW_EDGE_CENTER || edge == VIEW_EDGE_ALL) {
                                wlr_log(WLR_ERROR, "Invalid argument for action %s: '%s' (%s)",
                                        action_names[action->type], argument, content);
                        } else {