]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: fix setting of resize_edges
authorJohan Malm <jgm323@gmail.com>
Sun, 26 Dec 2021 21:35:37 +0000 (21:35 +0000)
committerJohan Malm <jgm323@gmail.com>
Sun, 26 Dec 2021 21:35:37 +0000 (21:35 +0000)
Only calculate nearest `resize_edges` if not clear from the server-side
deco under the cursor.

src/cursor.c

index b576b5c56fc30058ecf49040d2852371147cd854..f2c923a4e8d0cf76a3dabf364b49b93c63c171d8 100644 (file)
@@ -592,8 +592,12 @@ cursor_button(struct wl_listener *listener, void *data)
 
        /* Determine closest resize edges in case action is Resize */
        resize_edges = ssd_resize_edges(view_area);
-       resize_edges |= server->seat.cursor->x < view->x + view->w / 2 ? WLR_EDGE_LEFT : WLR_EDGE_RIGHT;
-       resize_edges |= server->seat.cursor->y < view->y + view->h / 2 ? WLR_EDGE_TOP : WLR_EDGE_BOTTOM;
+       if (!resize_edges) {
+               resize_edges |= server->seat.cursor->x < view->x + view->w / 2
+                       ? WLR_EDGE_LEFT : WLR_EDGE_RIGHT;
+               resize_edges |= server->seat.cursor->y < view->y + view->h / 2
+                       ? WLR_EDGE_TOP : WLR_EDGE_BOTTOM;
+       }
 
 mousebindings:
        if (event->state == WLR_BUTTON_RELEASED) {