]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Correctly handle current_output == NULL
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 24 Aug 2011 20:41:17 +0000 (22:41 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 24 Aug 2011 20:41:17 +0000 (22:41 +0200)
Fixes t/66-assign.t

src/floating.c

index 99d768a5054d18c78a25667961b11f0f873cfd19..a5ce1841c12c1c6b6f27dba8ca138447f87641ee 100644 (file)
@@ -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;
     }