diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-27 15:16:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-27 15:16:39 -0400 |
commit | b97160238fa5b61fef81316102559c8c3e137cd2 (patch) | |
tree | 053b69220543e8125847b3a240fbc5b580bbd7db /rootston/cursor.c | |
parent | 9f1ed70b81adc0680ba796a5545709036bc54408 (diff) | |
parent | 2718b5718047fb2388a9d3436cc9ca4436f75768 (diff) |
Merge pull request #347 from emersion/resize-all-edges
Force resize for all edges in rootston
Diffstat (limited to 'rootston/cursor.c')
-rw-r--r-- | rootston/cursor.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c index 1e44e3ae..ece115c4 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -275,17 +275,28 @@ static void do_cursor_button_press(struct roots_input *input, if (state == WLR_BUTTON_PRESSED && view && is_meta_pressed(input, device)) { set_view_focus(input, desktop, view); + uint32_t edges; switch (button) { case BTN_LEFT: view_begin_move(input, cursor, view); break; case BTN_RIGHT: - view_begin_resize(input, cursor, view, - ROOTS_CURSOR_RESIZE_EDGE_RIGHT | - ROOTS_CURSOR_RESIZE_EDGE_BOTTOM); + edges = 0; + if (sx < view->wlr_surface->current->width/2) { + edges |= ROOTS_CURSOR_RESIZE_EDGE_LEFT; + } else { + edges |= ROOTS_CURSOR_RESIZE_EDGE_RIGHT; + } + if (sy < view->wlr_surface->current->height/2) { + edges |= ROOTS_CURSOR_RESIZE_EDGE_TOP; + } else { + edges |= ROOTS_CURSOR_RESIZE_EDGE_BOTTOM; + } + view_begin_resize(input, cursor, view, edges); break; case BTN_MIDDLE: view_begin_rotate(input, cursor, view); + break; } return; } |