macos: update content scale whenever the screen changes (#3091)

Related to #2731

I'm not fully sure if this will fix this issue since I can't reproduce
it but I don't see a downside to doing this and it might fix it.
This commit is contained in:
Mitchell Hashimoto
2024-12-23 13:02:51 -08:00
committed by GitHub

View File

@ -409,6 +409,11 @@ extension Ghostty {
// ID. If vsync is enabled, this will be used with the CVDisplayLink to ensure // ID. If vsync is enabled, this will be used with the CVDisplayLink to ensure
// the proper refresh rate is going. // the proper refresh rate is going.
ghostty_surface_set_display_id(surface, screen.displayID ?? 0) ghostty_surface_set_display_id(surface, screen.displayID ?? 0)
// We also just trigger a backing property change. Just in case the screen has
// a different scaling factor, this ensures that we update our content scale.
// Issue: https://github.com/ghostty-org/ghostty/issues/2731
viewDidChangeBackingProperties()
} }
// MARK: - NSView // MARK: - NSView