mirror of
https://github.com/swaywm/sway.git
synced 2024-12-28 16:06:37 +01:00
Merge pull request #2344 from RyanDwyer/mod-resize-any-direction
Make mod+resize work in any direction
This commit is contained in:
commit
354731f161
1 changed files with 6 additions and 0 deletions
|
@ -460,6 +460,12 @@ static void dispatch_cursor_button_floating(struct sway_cursor *cursor,
|
|||
bool resizing_via_mod = button == BTN_RIGHT && mod_pressed;
|
||||
if ((resizing_via_border || resizing_via_mod) &&
|
||||
state == WLR_BUTTON_PRESSED) {
|
||||
if (edge == WLR_EDGE_NONE) {
|
||||
edge |= cursor->cursor->x > cont->x + cont->width / 2 ?
|
||||
WLR_EDGE_RIGHT : WLR_EDGE_LEFT;
|
||||
edge |= cursor->cursor->y > cont->y + cont->height / 2 ?
|
||||
WLR_EDGE_BOTTOM : WLR_EDGE_TOP;
|
||||
}
|
||||
seat_begin_resize(seat, cont, button, edge);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue