Merge branch 'fix-focustoggle'

next
Michael Stapelberg 2011-08-24 00:57:32 +02:00
commit 16f9c9aee7
2 changed files with 18 additions and 1 deletions

View File

@ -484,7 +484,7 @@ focus:
int to_focus = $2;
if ($2 == TOK_MODE_TOGGLE) {
current = TAILQ_FIRST(&(ws->focus_head));
if (current->type == CT_FLOATING_CON)
if (current != NULL && current->type == CT_FLOATING_CON)
to_focus = TOK_TILING;
else to_focus = TOK_FLOATING;
}

View File

@ -0,0 +1,17 @@
#!perl
# vim:ts=4:sw=4:expandtab
#
# Regression: Checks if i3 still lives after using 'focus mode_toggle' on an
# empty workspace. This regression was fixed in
# 0848844f2d41055f6ffc69af1149d7a873460976.
#
use i3test;
use v5.10;
my $tmp = fresh_workspace;
cmd 'focus mode_toggle';
does_i3_live;
done_testing;