From fc549978b9d10029e41c1cbdfe32a7a6d3c1b56d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 22 Oct 2023 09:22:56 -0700 Subject: [PATCH] macos: update inspector size in draw call --- macos/Sources/Ghostty/InspectorView.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/macos/Sources/Ghostty/InspectorView.swift b/macos/Sources/Ghostty/InspectorView.swift index 9f1590825..2145174a9 100644 --- a/macos/Sources/Ghostty/InspectorView.swift +++ b/macos/Sources/Ghostty/InspectorView.swift @@ -218,11 +218,6 @@ extension Ghostty { updateSize() } - override func resize(withOldSuperviewSize oldSize: NSSize) { - super.resize(withOldSuperviewSize: oldSize) - updateSize() - } - override func mouseDown(with event: NSEvent) { guard let inspector = self.inspector else { return } let mods = Ghostty.ghosttyMods(event.modifierFlags) @@ -428,6 +423,12 @@ extension Ghostty { return } + // We always update our size because sometimes draw is called + // between resize events and if our size is wrong with the underlying + // drawable we will crash. + updateSize() + + // Render ghostty_inspector_metal_render( inspector, Unmanaged.passRetained(commandBuffer).toOpaque(),