diff options
author | emersion <contact@emersion.fr> | 2018-07-24 12:10:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-24 12:10:08 +0100 |
commit | 354731f1616ec76385d3472bd0bf188f5a350796 (patch) | |
tree | 0ad866d4449bb374eedd624aaacdd8bebba0e4d6 | |
parent | Merge pull request #2303 from frsfnrrg/mouse-bindings (diff) | |
parent | Make mod+resize work in any direction (diff) | |
download | sway-354731f1616ec76385d3472bd0bf188f5a350796.tar.gz sway-354731f1616ec76385d3472bd0bf188f5a350796.tar.zst sway-354731f1616ec76385d3472bd0bf188f5a350796.zip |
Merge pull request #2344 from RyanDwyer/mod-resize-any-direction
Make mod+resize work in any direction
-rw-r--r-- | sway/input/cursor.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index f1481936..8a6299cf 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -460,6 +460,12 @@ static void dispatch_cursor_button_floating(struct sway_cursor *cursor, | |||
460 | bool resizing_via_mod = button == BTN_RIGHT && mod_pressed; | 460 | bool resizing_via_mod = button == BTN_RIGHT && mod_pressed; |
461 | if ((resizing_via_border || resizing_via_mod) && | 461 | if ((resizing_via_border || resizing_via_mod) && |
462 | state == WLR_BUTTON_PRESSED) { | 462 | state == WLR_BUTTON_PRESSED) { |
463 | if (edge == WLR_EDGE_NONE) { | ||
464 | edge |= cursor->cursor->x > cont->x + cont->width / 2 ? | ||
465 | WLR_EDGE_RIGHT : WLR_EDGE_LEFT; | ||
466 | edge |= cursor->cursor->y > cont->y + cont->height / 2 ? | ||
467 | WLR_EDGE_BOTTOM : WLR_EDGE_TOP; | ||
468 | } | ||
463 | seat_begin_resize(seat, cont, button, edge); | 469 | seat_begin_resize(seat, cont, button, edge); |
464 | return; | 470 | return; |
465 | } | 471 | } |