diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-18 17:50:37 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-18 17:50:37 +1000 |
commit | d22420689df44c2c6e984cdcc5de196577f12a1e (patch) | |
tree | 1d0cb9ea6bd04c139c16fc08461ea286d01c7a78 | |
parent | Merge pull request #2472 from RyanDwyer/refactor-seat-get-focus (diff) | |
download | sway-d22420689df44c2c6e984cdcc5de196577f12a1e.tar.gz sway-d22420689df44c2c6e984cdcc5de196577f12a1e.tar.zst sway-d22420689df44c2c6e984cdcc5de196577f12a1e.zip |
Fix mod+resize
Fixes #2479.
It was missing a mod_pressed check.
This also moves the parent traversal into the `if` block.
-rw-r--r-- | sway/input/cursor.c | 10 |
1 files 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, | |||
726 | } | 726 | } |
727 | 727 | ||
728 | // Via mod+click | 728 | // Via mod+click |
729 | struct sway_container *floater = cont; | ||
730 | while (floater->parent->layout != L_FLOATING) { | ||
731 | floater = floater->parent; | ||
732 | } | ||
733 | uint32_t btn_resize = config->floating_mod_inverse ? | 729 | uint32_t btn_resize = config->floating_mod_inverse ? |
734 | BTN_LEFT : BTN_RIGHT; | 730 | BTN_LEFT : BTN_RIGHT; |
735 | if (button == btn_resize) { | 731 | if (mod_pressed && button == btn_resize) { |
732 | struct sway_container *floater = cont; | ||
733 | while (floater->parent->layout != L_FLOATING) { | ||
734 | floater = floater->parent; | ||
735 | } | ||
736 | edge = 0; | 736 | edge = 0; |
737 | edge |= cursor->cursor->x > floater->x + floater->width / 2 ? | 737 | edge |= cursor->cursor->x > floater->x + floater->width / 2 ? |
738 | WLR_EDGE_RIGHT : WLR_EDGE_LEFT; | 738 | WLR_EDGE_RIGHT : WLR_EDGE_LEFT; |