git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit0e0d744537e83f0035d34cb626950394931b75fa
parent16b5864ada
authornovakne <[email protected]>
date2021-04-22 07:46
pixman: update and fix PointerConstraint

 deps/zig-pixman             | 2 +-
 river/PointerConstraint.zig | 9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/deps/zig-pixman b/deps/zig-pixman
index f8e682a..9acac69 160000
--- a/deps/zig-pixman
+++ b/deps/zig-pixman
@@ -1 +1 @@
-Subproject commit f8e682ac2f640368ebb414aa2e7db6a2be1b179e
+Subproject commit 9acac698e073ff54b09a62fecb144de326f67626
diff --git a/river/PointerConstraint.zig b/river/PointerConstraint.zig
index fc5cf20..3e9667f 100644
--- a/river/PointerConstraint.zig
+++ b/river/PointerConstraint.zig
@@ -85,12 +85,11 @@ fn constrainToRegion(self: *Self) void {
         var box: pixman.Box32 = undefined;
 
         if (!self.constraint.region.containsPoint(cx, cy, &box)) {
-            var nRects: c_int = undefined;
-            const rects = self.constraint.region.rectangles(&nRects);
+            const rects = self.constraint.region.rectangles();
 
-            if (nRects > 0) {
-                const new_cx = @intToFloat(f64, view.current.box.x + rects.x1 + @divFloor(rects.x2, 2));
-                const new_cy = @intToFloat(f64, view.current.box.y + rects.y1 + @divFloor(rects.y2, 2));
+            if (rects.len > 0) {
+                const new_cx = @intToFloat(f64, view.current.box.x + rects[0].x1 + @divFloor(rects[0].x2, 2));
+                const new_cy = @intToFloat(f64, view.current.box.y + rects[0].y1 + @divFloor(rects[0].y2, 2));
 
                 self.cursor.wlr_cursor.warpClosest(null, new_cx, new_cy);
             }