]> git.mdlowis.com Git - proto/labwc.git/commitdiff
correctly detect when cursor is over titlebar
authorbi4k8 <bi4k8@github>
Thu, 2 Dec 2021 23:05:23 +0000 (23:05 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 3 Dec 2021 06:42:04 +0000 (06:42 +0000)
this was broken when we added ssd_part_types other than NONE that are not decoration

src/cursor.c

index c1ce2f272559ee308fdabec014ed50e34c99ff47..8752ca98f9b8cfde861e0acd768283c7fbd94899 100644 (file)
@@ -194,19 +194,23 @@ process_cursor_motion(struct server *server, uint32_t time)
                server->seat.cursor->x, server->seat.cursor->y, &surface,
                &sx, &sy, &view_area);
 
+       /* Set cursor */
        if (!view) {
+               /* root, etc. */
                cursor_set(&server->seat, XCURSOR_DEFAULT);
        } else {
+               /* resize handles */
                uint32_t resize_edges = ssd_resize_edges(view_area);
                if (resize_edges) {
                        cursor_name_set_by_server = true;
                        cursor_set(&server->seat,
                                wlr_xcursor_get_resize_name(resize_edges));
-               } else if (view_area != LAB_SSD_NONE) {
+               } else if (ssd_part_contains(LAB_SSD_PART_TITLEBAR, view_area)) {
                        /* title and buttons */
                        cursor_set(&server->seat, XCURSOR_DEFAULT);
                        cursor_name_set_by_server = true;
                } else if (cursor_name_set_by_server) {
+                       /* window content */
                        cursor_set(&server->seat, XCURSOR_DEFAULT);
                        cursor_name_set_by_server = false;
                }