Disallow moving a container to itself since this would crash i3.
This commit is contained in:
parent
05e8caab17
commit
283b231290
|
@ -914,6 +914,11 @@ bool con_move_to_mark(Con *con, const char *mark) {
|
||||||
target = TAILQ_FIRST(&(target->focus_head));
|
target = TAILQ_FIRST(&(target->focus_head));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (con == target) {
|
||||||
|
DLOG("cannot move the container to itself, aborting.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return _con_move_to_con(con, target, false, true, false);
|
return _con_move_to_con(con, target, false, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -268,6 +268,21 @@ sync_with_i3;
|
||||||
($nodes, $focus) = get_ws_content($target_ws);
|
($nodes, $focus) = get_ws_content($target_ws);
|
||||||
is(@{$nodes}, 1, 'tiling container moved to the target workspace');
|
is(@{$nodes}, 1, 'tiling container moved to the target workspace');
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Given 'S' and 'M' are the same container, when 'S' is moved to 'M', then
|
||||||
|
# the command is ignored.
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
$ws = fresh_workspace;
|
||||||
|
$S = open_window;
|
||||||
|
$M = $S;
|
||||||
|
cmd 'mark target';
|
||||||
|
|
||||||
|
cmd '[id="' . $S->{id} . '"] move container to mark target';
|
||||||
|
sync_with_i3;
|
||||||
|
|
||||||
|
does_i3_live;
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
done_testing;
|
done_testing;
|
||||||
|
|
Loading…
Reference in New Issue