diff options
author | Orestis Floros <orestisflo@gmail.com> | 2020-04-10 12:17:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-10 12:17:26 +0200 |
commit | b401cc994b75d1305db46bebb7b7795184aaf328 (patch) | |
tree | ef57bac88abc345ab3facc85b7016b11ff4e39a8 | |
parent | 59108ec299495e5664e381c138c20d70717ed890 (diff) | |
parent | d36829d6e29a5b6db56b604e3eff86a35afa02e4 (diff) | |
download | i3-b401cc994b75d1305db46bebb7b7795184aaf328.tar.gz i3-b401cc994b75d1305db46bebb7b7795184aaf328.zip |
Merge pull request #3954 from xzfc/floating-tiling-resize
Make floating-tiling resize code consistent with plain tiling resize
-rw-r--r-- | src/click.c | 10 | ||||
-rw-r--r-- | src/resize.c | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/click.c b/src/click.c index 7a3fde36..811f74d5 100644 --- a/src/click.c +++ b/src/click.c @@ -242,18 +242,18 @@ static void route_click(Con *con, xcb_button_press_event_t *event, const bool mo /* 5: resize (floating) if this was a (left or right) click on the * left/right/bottom border, or a right click on the decoration. - * also try resizing (tiling) if it was a click on the top */ + * also try resizing (tiling) if possible */ if (mod_pressed && event->detail == XCB_BUTTON_CLICK_RIGHT) { DLOG("floating resize due to floatingmodifier\n"); floating_resize_window(floatingcon, proportional, event); return; } - if (!in_stacked && dest == CLICK_DECORATION && + if ((dest == CLICK_BORDER || dest == CLICK_DECORATION) && is_left_or_right_click) { /* try tiling resize, but continue if it doesn’t work */ DLOG("tiling resize with fallback\n"); - if (tiling_resize(con, event, dest, !was_focused)) + if (tiling_resize(con, event, dest, dest == CLICK_DECORATION && !was_focused)) goto done; } @@ -290,10 +290,6 @@ static void route_click(Con *con, xcb_button_press_event_t *event, const bool mo else if ((dest == CLICK_BORDER || dest == CLICK_DECORATION) && is_left_or_right_click) { DLOG("Trying to resize (tiling)\n"); - /* Since we updated the tree (con_activate() above), we need to - * re-render the tree before returning to the event loop (drag_pointer() - * inside tiling_resize() runs its own event-loop). */ - tree_render(); tiling_resize(con, event, dest, dest == CLICK_DECORATION && !was_focused); } diff --git a/src/resize.c b/src/resize.c index 97a0f946..6ad92cc0 100644 --- a/src/resize.c +++ b/src/resize.c @@ -238,6 +238,10 @@ void resize_graphical_handler(Con *first, Con *second, orientation_t orientation const struct callback_params params = {orientation, output, helpwin, &new_position, &threshold_exceeded}; + /* Re-render the tree before returning to the event loop (drag_pointer() + * runs its own event-loop) in case if there are unrendered updates. */ + tree_render(); + /* `drag_pointer' blocks until the drag is completed. */ drag_result_t drag_result = drag_pointer(NULL, event, grabwin, 0, use_threshold, resize_callback, ¶ms); |