]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: don’t crash when dragged floating window closes (Thanks darkraven)
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 28 Sep 2012 16:23:01 +0000 (18:23 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 28 Sep 2012 16:23:01 +0000 (18:23 +0200)
Previously, while the loop would not be executed anymore, the callback
(for actually repositioning the window after a MotionNotify) would still
get called once. This commit avoids that, thus fixing the crash.

fixes #819

src/floating.c

index 3d2c1d3191fb4f8b1367bf19a2f2aaf9cf64e691..5df39bf10342a189f5990db96d03c2fadb263b9e 100644 (file)
@@ -570,7 +570,7 @@ void drag_pointer(Con *con, const xcb_button_press_event_t *event, xcb_window_t
                 free(inside_event);
         } while ((inside_event = xcb_poll_for_event(conn)) != NULL);
 
-        if (last_motion_notify == NULL)
+        if (last_motion_notify == NULL || loop_done)
             continue;
 
         new_x = ((xcb_motion_notify_event_t*)last_motion_notify)->root_x;