From 254f526f71311bfe52d547f5430dda8606f31cda Mon Sep 17 00:00:00 2001 From: lynxy Date: Thu, 3 Jul 2025 00:39:32 +0200 Subject: [PATCH] actions: prevent users entering invalid direction=any value --- src/action.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/action.c b/src/action.c index a88ce309..6df68979 100644 --- a/src/action.c +++ b/src/action.c @@ -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 {