diff --git a/Packages/VNCUI/Sources/VNCUI/Session/FramebufferUIView.swift b/Packages/VNCUI/Sources/VNCUI/Session/FramebufferUIView.swift index bfa0afc..d0ef7f0 100644 --- a/Packages/VNCUI/Sources/VNCUI/Session/FramebufferUIView.swift +++ b/Packages/VNCUI/Sources/VNCUI/Session/FramebufferUIView.swift @@ -86,6 +86,17 @@ final class FramebufferUIView: UIView, imageLayer.magnificationFilter = .nearest imageLayer.minificationFilter = .linear imageLayer.contentsGravity = .resize + // Kill CALayer's implicit animations — we want every framebuffer + // update to be an instantaneous blit, not a 0.25s crossfade. + imageLayer.actions = [ + "contents": NSNull(), + "contentsRect": NSNull(), + "position": NSNull(), + "bounds": NSNull(), + "frame": NSNull(), + "transform": NSNull(), + "backgroundColor": NSNull() + ] layer.addSublayer(imageLayer) configureGestureRecognizers() @@ -161,8 +172,11 @@ final class FramebufferUIView: UIView, } func apply(image: CGImage?, framebufferSize: CGSize) { + CATransaction.begin() + CATransaction.setDisableActions(true) imageLayer.contents = image applyLayerFrame() + CATransaction.commit() } private func applyLayerFrame() {