cmd_move_to_mark: fix move to scratchpad hidden
This fixes the case where moving a container to a scratchpad hidden container via a mark would cause the container to be tiling on the __i3_scratch workspace. This still moves the container to the __i3_scratch workspace, but properly adds it to the scratchpad so that it becomes usable instead of requiring criteria to regain access to.
This commit is contained in:
parent
a4b5deed73
commit
741e94ae4f
|
@ -1298,6 +1298,13 @@ bool con_move_to_mark(Con *con, const char *mark) {
|
|||
return false;
|
||||
}
|
||||
|
||||
/* For target containers in the scratchpad, we just send the window to the scratchpad. */
|
||||
if (con_get_workspace(target) == workspace_get("__i3_scratch", NULL)) {
|
||||
DLOG("target container is in the scratchpad, moving container to scratchpad.\n");
|
||||
scratchpad_move(con);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* For floating target containers, we just send the window to the same workspace. */
|
||||
if (con_is_floating(target)) {
|
||||
DLOG("target container is floating, moving container to target's workspace.\n");
|
||||
|
|
|
@ -24,6 +24,7 @@ use i3test;
|
|||
|
||||
my ($A, $B, $S, $M, $F, $source_ws, $target_ws, $ws);
|
||||
my ($nodes, $focus);
|
||||
my $__i3_scratch;
|
||||
my $cmd_result;
|
||||
|
||||
my $_NET_WM_STATE_REMOVE = 0;
|
||||
|
@ -401,6 +402,29 @@ is(@{$nodes}, 2, 'there is a window and a container with the contents of the ori
|
|||
is($nodes->[0]->{window}, $M->{id}, 'M remains the first window');
|
||||
is(@{get_ws($target_ws)->{floating_nodes}}, 1, 'target workspace has the floating container');
|
||||
|
||||
###############################################################################
|
||||
# Given 'S' and 'M', where 'S' is a container and 'M' is a container hidden in
|
||||
# the scratchpad, then move 'S' to the scratchpad
|
||||
###############################################################################
|
||||
|
||||
$ws = fresh_workspace;
|
||||
$S = open_window;
|
||||
cmd 'mark S';
|
||||
$M = open_window;
|
||||
cmd 'mark target';
|
||||
cmd 'move container to scratchpad';
|
||||
|
||||
cmd '[con_mark=S] move container to mark target';
|
||||
sync_with_i3;
|
||||
|
||||
($nodes, $focus) = get_ws_content($ws);
|
||||
is(@{$nodes}, 0, 'there are no tiling windows on the workspace');
|
||||
is(@{get_ws($ws)->{floating_nodes}}, 0, 'there are no floating containers on the workspace');
|
||||
|
||||
$__i3_scratch = get_ws('__i3_scratch');
|
||||
is(@{$__i3_scratch->{nodes}}, 0, 'there are no tiling windows on the scratchpad workspace');
|
||||
is(@{$__i3_scratch->{floating_nodes}}, 2, 'there are two floating containers in the scratchpad');
|
||||
|
||||
###############################################################################
|
||||
|
||||
done_testing;
|
||||
|
|
Loading…
Reference in New Issue