another window or screen edge. If set to "no", only move to
the next screen edge. Default is yes.
-*<action name="Resize" />*
+*<action name="Resize" direction="value" />*
Begin interactive resize of window under cursor.
+ *direction* [up|down|left|right|up-left|up-right|down-left|down-right]
+ Edge or corner from which to start resizing. If this is not provided,
+ the direction is inferred from the cursor position.
+
*<action name="ResizeRelative" left="" right="" top="" bottom="" />*
Resize window relative to its current size. Values of left, right,
top or bottom tell how much to resize on that edge of window,
goto cleanup;
}
break;
+ case ACTION_TYPE_RESIZE:
+ if (!strcmp(argument, "direction")) {
+ enum lab_edge edge = lab_edge_parse(content,
+ /*tiled*/ true, /*any*/ false);
+ if (edge == LAB_EDGE_NONE || edge == LAB_EDGE_CENTER) {
+ wlr_log(WLR_ERROR,
+ "Invalid argument for action %s: '%s' (%s)",
+ action_names[action->type], argument, content);
+ } else {
+ action_arg_add_int(action, argument, edge);
+ }
+ goto cleanup;
+ }
+ break;
case ACTION_TYPE_RESIZE_RELATIVE:
if (!strcmp(argument, "left") || !strcmp(argument, "right") ||
!strcmp(argument, "top") || !strcmp(argument, "bottom")) {
break;
case ACTION_TYPE_RESIZE:
if (view) {
- enum lab_edge resize_edges = cursor_get_resize_edges(
- server->seat.cursor, ctx);
+ /*
+ * If a direction was specified in the config, honour it.
+ * Otherwise, fall back to determining the resize edges from
+ * the current cursor position (existing behaviour).
+ */
+ enum lab_edge resize_edges =
+ action_get_int(action, "direction", LAB_EDGE_NONE);
+ if (resize_edges == LAB_EDGE_NONE) {
+ resize_edges = cursor_get_resize_edges(
+ server->seat.cursor, ctx);
+ }
interactive_begin(view, LAB_INPUT_STATE_RESIZE,
resize_edges);
}