mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-30 15:08:38 +00:00
fix(macOS): Prevent janky transition animation on DPI change
This commit is contained in:
@@ -417,7 +417,13 @@ extension Ghostty {
|
|||||||
// Ref: High Resolution Guidelines for OS X
|
// Ref: High Resolution Guidelines for OS X
|
||||||
// https://developer.apple.com/library/archive/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW27
|
// https://developer.apple.com/library/archive/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW27
|
||||||
if let window = window {
|
if let window = window {
|
||||||
|
CATransaction.begin()
|
||||||
|
// Disable the implicit transition animation that Core Animation applies to
|
||||||
|
// property changes. Otherwise it will apply a scale animation to the layer
|
||||||
|
// contents which looks pretty janky.
|
||||||
|
CATransaction.setDisableActions(true)
|
||||||
layer?.contentsScale = window.backingScaleFactor
|
layer?.contentsScale = window.backingScaleFactor
|
||||||
|
CATransaction.commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
guard let surface = self.surface else { return }
|
guard let surface = self.surface else { return }
|
||||||
|
Reference in New Issue
Block a user