Bugfix: Fix crash when moving a floating Con to a different workspace, add testcase (Thanks EelVex)

This commit is contained in:
Michael Stapelberg 2010-11-29 20:20:44 +01:00
parent b0068de3d7
commit ad825913b4
2 changed files with 24 additions and 0 deletions

View File

@ -415,6 +415,11 @@ void con_toggle_fullscreen(Con *con) {
*
*/
void con_move_to_workspace(Con *con, Con *workspace) {
if (con_is_floating(con)) {
DLOG("Using FLOATINGCON instead\n");
con = con->parent;
}
/* 1: save the container which is going to be focused after the current
* container is moved away */
Con *focus_next = con_next_focused(con);

View File

@ -0,0 +1,19 @@
#!perl
# vim:ts=4:sw=4:expandtab
#
# Regression: move a floating window to a different workspace crashes i3
#
use i3test tests => 1;
use X11::XCB qw(:all);
my $tmp = get_unused_workspace();
my $otmp = get_unused_workspace();
cmd "workspace $tmp";
cmd 'open';
cmd 'mode toggle';
cmd "move workspace $otmp";
my $tree = i3('/tmp/nestedcons')->get_tree->recv;
my @nodes = @{$tree->{nodes}};
ok(@nodes > 0, 'i3 still lives');