Sync joystick resume correction from VCC Plus 1bd2b50e

This commit is contained in:
Brian Holman committed 2026-11-14 02:31:30 -07:00
1 parent b2ecec4d87
commit 8236ca17c6
4 files changed
+34 -6

No files matched your search

+9
View File
@@ -568,8 +568,12 @@ final class MachineModel: ObservableObject {
private var polling = false
private var imageGeneration: UInt64 = 0
private var imageRevision: UInt64 = 0
private var observedInputGeneration: UInt64?
private func accept(_ snapshot: VCCMachineSnapshot) {
let inputNeedsResynchronization = snapshot.state == .running &&
(state != .running || snapshot.generation != observedInputGeneration)
observedInputGeneration = snapshot.generation
diskEditorLocked = snapshot.diskEditorLocked
printer.observe(snapshot)
let basic = BASICDebugState(attached: snapshot.basicDebugAttached,
@@ -631,6 +635,11 @@ final class MachineModel: ObservableObject {
let nextHardware = HardwareState(snapshot: snapshot, activities: activity, sdcActivity: sdcActivity)
if hardware != nextHardware { hardware = nextHardware }
state = snapshot.state
// The core deliberately ignores host joystick submissions while paused.
// Reapply the configured interfaces only after a resume/new machine is
// running, even when neutral axes match the host's cached last sample.
// Do not initialize native input solely for receiving a snapshot.
if inputNeedsResynchronization { existingInputHub?.release() }
frames = snapshot.frames
error = snapshot.errorMessage
guard snapshot.pixels != nil else {