Make command move [direction] work with criteria

A container selected with criteria should be moved with the `move
[direction]` command, instead of this command always acting on the
focused container.
This commit is contained in:
Tony Crisci
2014-06-19 08:09:31 -04:00
committed by Michael Stapelberg
parent c936232545
commit c2b6b06da7
4 changed files with 68 additions and 22 deletions

@ -132,18 +132,17 @@ static void move_to_output_directed(Con *con, direction_t direction) {
}
/*
* Moves the current container in the given direction (D_LEFT, D_RIGHT,
* Moves the given container in the given direction (D_LEFT, D_RIGHT,
* D_UP, D_DOWN).
*
*/
void tree_move(int direction) {
void tree_move(Con *con, int direction) {
position_t position;
Con *target;
DLOG("Moving in direction %d\n", direction);
/* 1: get the first parent with the same orientation */
Con *con = focused;
if (con->type == CT_WORKSPACE) {
DLOG("Not moving workspace\n");