]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/cursor.c: refactor nested if-statements
authorJohan Malm <jgm323@gmail.com>
Tue, 16 Aug 2022 20:57:37 +0000 (21:57 +0100)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 17 Aug 2022 12:03:38 +0000 (14:03 +0200)
src/cursor.c

index 68b2410e03611f5277897629b09597405fb65626..86bac65906ff324426a5142d40601604b0b86ced 100644 (file)
@@ -303,14 +303,13 @@ process_cursor_motion(struct server *server, uint32_t time)
                sx = server->seat.cursor->x - lx;
                sy = server->seat.cursor->y - ly;
 
-               if (view && view->type == LAB_XDG_SHELL_VIEW) {
-                       /* Take into account invisible CSD borders */
-                       if (view->xdg_surface) {
-                               struct wlr_box geo;
-                               wlr_xdg_surface_get_geometry(view->xdg_surface, &geo);
-                               sx += geo.x;
-                               sy += geo.y;
-                       }
+               /* Take into account invisible xdg-shell CSD borders */
+               if (view && view->type == LAB_XDG_SHELL_VIEW
+                               && view->xdg_surface) {
+                       struct wlr_box geo;
+                       wlr_xdg_surface_get_geometry(view->xdg_surface, &geo);
+                       sx += geo.x;
+                       sy += geo.y;
                }
                wlr_seat_pointer_notify_motion(server->seat.seat, time, sx, sy);
        } else if (surface && !input_inhibit_blocks_surface(