mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 01:06:08 +03:00
apprt/embedded: ignore size callbacks that change nothing
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user