fix(apple/cursor): disable M3 visibility-based auto-flip — it broke desktop drags
On-glass (Mac ↔ Windows M2c host): the host cursor's VISIBILITY is not a usable 'a game grabbed the mouse' signal — Windows hides the pointer for ordinary desktop activity (clicking, typing). The per-frame forwarder turned those transients into relative_hint=true, so the client flipped desktop→capture→desktop, which (a) warped the cursor to view-centre and (b) flushed held buttons via releaseAll — a spurious mouse-up ~200 ms into every press that broke window dragging/resizing. Disable the auto-flip; the mouse model stays user-driven (⌃⌥⇧M). The hint still rides the wire, unused, for a future M3 that keys off a REAL pointer-lock signal (host-side ClipCursor/raw-input detection) instead of visibility. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -567,17 +567,14 @@ public final class StreamLayerView: NSView {
|
|||||||
if prev?.visible != ev.visible || prev?.serial != ev.serial {
|
if prev?.visible != ev.visible || prev?.serial != ev.serial {
|
||||||
window?.invalidateCursorRects(for: self)
|
window?.invalidateCursorRects(for: self)
|
||||||
}
|
}
|
||||||
// M3 — host-driven mode flip, edge-triggered (a fresh host intent clears a manual
|
// M3 host-driven auto-flip is DISABLED: `relative_hint` is derived from host cursor
|
||||||
// override): hint ⇒ captured relative; clear ⇒ absolute, reappearing at the host's
|
// VISIBILITY, and Windows hides the pointer for ordinary desktop activity (clicking,
|
||||||
// last pointer position.
|
// typing) — not just when a game grabs it. Acting on those transients flipped
|
||||||
if lastHint != ev.relativeHint {
|
// desktop→capture→desktop, which warped the cursor to view-centre and flushed held
|
||||||
lastHint = ev.relativeHint
|
// buttons (a spurious button-up ~200 ms into every press → broke window drags). Until
|
||||||
hintOverride = false
|
// the host exposes a real pointer-LOCK signal (ClipCursor/raw-input, not visibility),
|
||||||
}
|
// the mouse model is user-driven only (⌃⌥⇧M). The hint still rides the wire, unused.
|
||||||
if !hintOverride, captured, desktopMouse == ev.relativeHint {
|
_ = (lastHint, hintOverride)
|
||||||
setDesktopMouse(!ev.relativeHint, reappearAt: ev.relativeHint ? nil : (ev.x, ev.y))
|
|
||||||
streamInputLog.info("host cursor hint: mouse model flipped to \(self.desktopMouse ? "desktop" : "capture", privacy: .public)")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Build an `NSCursor` from a forwarded straight-alpha RGBA shape.
|
/// Build an `NSCursor` from a forwarded straight-alpha RGBA shape.
|
||||||
|
|||||||
Reference in New Issue
Block a user