Skip to content

Commit

Permalink
macos: update content scale whenever the screen changes (#3091)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mitchellh authored Dec 23, 2024
2 parents 5daf778 + 53ac0aa commit 1584fc1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions macos/Sources/Ghostty/SurfaceView_AppKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,11 @@ extension Ghostty {
// ID. If vsync is enabled, this will be used with the CVDisplayLink to ensure
// the proper refresh rate is going.
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
Expand Down

0 comments on commit 1584fc1

Please sign in to comment.