mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +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 {
|
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 = .{
|
self.size = .{
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
|
Reference in New Issue
Block a user