From: lynxy Date: Wed, 2 Jul 2025 22:39:32 +0000 (+0200) Subject: actions: prevent users entering invalid direction=any value X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=254f526f71311bfe52d547f5430dda8606f31cda;p=proto%2Flabwc.git actions: prevent users entering invalid direction=any value --- 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 {