diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index 8db67b0a1..0a21504e7 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -206,6 +206,12 @@ pub const Surface = struct { } pub fn updateSize(self: *Surface, width: u32, height: u32) void { + // Runtimes sometimes generate superflous resize events even + // if the size did not actually change (SwiftUI). We check + // that the size actually changed from what we last recorded + // since resizes are expensive. + if (self.size.width == width and self.size.height == height) return; + self.size = .{ .width = width, .height = height,