*<action name="MoveTo" x="" y="" />*
Move to position (x, y)
+*<action name="ResizeTo" width="" height="" />*
+ Resize window
+
+ *width* The width to resize the window to in pixels.
+
+ *height* The height to resize the window to in pixels.
+
*<action name="MoveToCursor" />*
Move to be centered on cursor.
Tries to prevent any part of the window from going off-screen.
ACTION_TYPE_RESIZE,
ACTION_TYPE_RESIZE_RELATIVE,
ACTION_TYPE_MOVETO,
+ ACTION_TYPE_RESIZETO,
ACTION_TYPE_MOVETO_CURSOR,
ACTION_TYPE_MOVE_RELATIVE,
ACTION_TYPE_SEND_TO_DESKTOP,
"Resize",
"ResizeRelative",
"MoveTo",
+ "ResizeTo",
"MoveToCursor",
"MoveRelative",
"SendToDesktop",
goto cleanup;
}
break;
+ case ACTION_TYPE_RESIZETO:
+ if (!strcmp(argument, "width") || !strcmp(argument, "height")) {
+ action_arg_add_int(action, argument, atoi(content));
+ goto cleanup;
+ }
+ break;
case ACTION_TYPE_SEND_TO_DESKTOP:
if (!strcmp(argument, "follow")) {
action_arg_add_bool(action, argument, parse_bool(content, true));
view_move(view, x, y);
}
break;
+ case ACTION_TYPE_RESIZETO:
+ if (view) {
+ int width = action_get_int(action, "width", 0);
+ int height = action_get_int(action, "height", 0);
+
+ /*
+ * To support only setting one of width/height
+ * in <action name="ResizeTo" width="" height=""/>
+ * we fall back to current dimension when unset.
+ */
+ struct wlr_box box = {
+ .x = view->pending.x,
+ .y = view->pending.y,
+ .width = width ? : view->pending.width,
+ .height = height ? : view->pending.height,
+ };
+ view_move_resize(view, box);
+ }
+ break;
case ACTION_TYPE_MOVE_RELATIVE:
if (view) {
int x = action_get_int(action, "x", 0);