gtk/wayland: clean up blur regions

Destroy temporary Wayland regions after each blur update and release
the previous cached blur region before replacing it. This prevents
resources from leaking while the blur region changes.
This commit is contained in:
Omkar Chandorkar
2026-08-08 15:22:23 +05:30
parent 6e647a1cbd
commit a6fc3e0e2e

View File

@@ -306,7 +306,7 @@ pub const Window = struct {
}
const wl_region = try compositor.createRegion();
errdefer if (wl_region) |r| r.destroy();
defer wl_region.destroy();
for (region.slices.items) |s| wl_region.add(
@intCast(s.x),
@intCast(s.y),
@@ -315,6 +315,7 @@ pub const Window = struct {
);
bg.setBlurRegion(wl_region);
self.blur_region.deinit(self.globals.alloc);
self.blur_region = region;
}