From d22420689df44c2c6e984cdcc5de196577f12a1e Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 18 Aug 2018 17:50:37 +1000 Subject: Fix mod+resize Fixes #2479. It was missing a mod_pressed check. This also moves the parent traversal into the `if` block. --- sway/input/cursor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 3b70b471..6208ce32 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -726,13 +726,13 @@ void dispatch_cursor_button(struct sway_cursor *cursor, } // Via mod+click - struct sway_container *floater = cont; - while (floater->parent->layout != L_FLOATING) { - floater = floater->parent; - } uint32_t btn_resize = config->floating_mod_inverse ? BTN_LEFT : BTN_RIGHT; - if (button == btn_resize) { + if (mod_pressed && button == btn_resize) { + struct sway_container *floater = cont; + while (floater->parent->layout != L_FLOATING) { + floater = floater->parent; + } edge = 0; edge |= cursor->cursor->x > floater->x + floater->width / 2 ? WLR_EDGE_RIGHT : WLR_EDGE_LEFT; -- cgit v1.2.3-54-g00ecf