Check if con_id exists in cmd_swap (#2898)
Also adds some testcases for swap using con_id. Fixes #2895
This commit is contained in:
committed by
Michael Stapelberg
parent
85eb097677
commit
66f2148236
@ -32,6 +32,38 @@ my ($nodes, $expected_focus, $A, $B, $F);
|
||||
my ($result);
|
||||
my @urgent;
|
||||
|
||||
###############################################################################
|
||||
# Invalid con_id should not crash i3
|
||||
# See issue #2895.
|
||||
###############################################################################
|
||||
|
||||
$pid = launch_with_config($config);
|
||||
$ws = fresh_workspace;
|
||||
|
||||
open_window;
|
||||
cmd "swap container with con_id 1";
|
||||
|
||||
does_i3_live;
|
||||
exit_gracefully($pid);
|
||||
|
||||
###############################################################################
|
||||
# Swap 2 windows in different workspaces using con_id
|
||||
###############################################################################
|
||||
|
||||
$pid = launch_with_config($config);
|
||||
|
||||
$ws = fresh_workspace;
|
||||
open_window;
|
||||
$A = get_focused($ws);
|
||||
|
||||
$ws = fresh_workspace;
|
||||
open_window;
|
||||
|
||||
cmd "swap container with con_id $A";
|
||||
is(get_focused($ws), $A, 'A is now focused');
|
||||
|
||||
exit_gracefully($pid);
|
||||
|
||||
###############################################################################
|
||||
# Swap two containers next to each other.
|
||||
# Focus should stay on B because both windows are on the focused workspace.
|
||||
|
Reference in New Issue
Block a user