]> git.sur5r.net Git - i3/i3/commitdiff
floating_drag_window: return on DRAG_REVERT 3365/head
authorOrestis Floros <orestisf1993@gmail.com>
Tue, 21 Aug 2018 18:06:00 +0000 (21:06 +0300)
committerOrestis Floros <orestisf1993@gmail.com>
Tue, 21 Aug 2018 18:06:00 +0000 (21:06 +0300)
Right now tree_render() is called twice on DRAG_REVERT since
floating_reposition calls it.
Also, on DRAG_REVERT the scratchpad state shouldn't change since the
user canceled the action.

src/floating.c

index 9c15bb10e243ca1eec3c1289648107f0c57948ab..7ba7c9fb09d1353390ef924a52f43e2b58ef708d 100644 (file)
@@ -537,8 +537,10 @@ void floating_drag_window(Con *con, const xcb_button_press_event_t *event) {
     }
 
     /* If the user cancelled, undo the changes. */
-    if (drag_result == DRAG_REVERT)
+    if (drag_result == DRAG_REVERT) {
         floating_reposition(con, initial_rect);
+        return;
+    }
 
     /* If this is a scratchpad window, don't auto center it from now on. */
     if (con->scratchpad_state == SCRATCHPAD_FRESH)