From: Michael Stapelberg Date: Wed, 24 Aug 2011 20:41:17 +0000 (+0200) Subject: Bugfix: Correctly handle current_output == NULL X-Git-Tag: 4.0.2~26^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7558c1ddbd4a828f22dbb3e5378e19f8b92c9c10;p=i3%2Fi3 Bugfix: Correctly handle current_output == NULL Fixes t/66-assign.t --- diff --git a/src/floating.c b/src/floating.c index 99d768a5..a5ce1841 100644 --- a/src/floating.c +++ b/src/floating.c @@ -146,8 +146,8 @@ void floating_enable(Con *con, bool automatic) { nc->rect.x, nc->rect.y); /* Take the relative coordinates of the current output, then add them * to the coordinate space of the correct output */ - uint32_t rel_x = (nc->rect.x - current_output->con->rect.x); - uint32_t rel_y = (nc->rect.y - current_output->con->rect.y); + uint32_t rel_x = (nc->rect.x - (current_output ? current_output->con->rect.x : 0)); + uint32_t rel_y = (nc->rect.y - (current_output ? current_output->con->rect.y : 0)); nc->rect.x = correct_output->rect.x + rel_x; nc->rect.y = correct_output->rect.y + rel_y; }