mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-24 16:11:43 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user