# defaults to 10 pixels.
move <left|right|down|up> [<px> px]
-# Moves the container either to a specific location
-# or to the center of the screen. If 'absolute' is
-# used, it is moved to the center of all outputs.
-move [absolute] position <pos_x> [px] <pos_y> [px]
+# Moves the container to the specified pos_x and pos_y
+# coordinates on the screen.
+move position <pos_x> [px] <pos_y> [px]
+
+# Moves the container to the center of the screen.
+# If 'absolute' is used, it is moved to the center of
+# all outputs.
move [absolute] position center
# Moves the container to the current position of the
* Implementation of 'move [window|container] [to] [absolute] position <px> [px] <px> [px]
*
*/
-void cmd_move_window_to_position(I3_CMD, const char *method, long x, long y);
+void cmd_move_window_to_position(I3_CMD, long x, long y);
/**
* Implementation of 'move [window|container] [to] [absolute] position center
* Implementation of 'move [window|container] [to] [absolute] position <px> [px] <px> [px]
*
*/
-void cmd_move_window_to_position(I3_CMD, const char *method, long x, long y) {
+void cmd_move_window_to_position(I3_CMD, long x, long y) {
bool has_error = false;
owindow *current;
continue;
}
- if (strcmp(method, "absolute") == 0) {
- current->con->parent->rect.x = x;
- current->con->parent->rect.y = y;
+ Rect newrect = current->con->parent->rect;
- DLOG("moving to absolute position %ld %ld\n", x, y);
- floating_maybe_reassign_ws(current->con->parent);
- cmd_output->needs_tree_render = true;
- }
+ DLOG("moving to position %ld %ld\n", x, y);
+ newrect.x = x;
+ newrect.y = y;
- if (strcmp(method, "position") == 0) {
- Rect newrect = current->con->parent->rect;
-
- DLOG("moving to position %ld %ld\n", x, y);
- newrect.x = x;
- newrect.y = y;
-
- floating_reposition(current->con->parent, newrect);
- }
+ floating_reposition(current->con->parent, newrect);
}
// XXX: default reply for now, make this a better reply