CNA-BUG-263: TerminalMouse::SetPosition throws PlatformException although IPlatformMouse::SetPosition documents no exception, so XNA's Mouse.SetPosition throws on the terminal platform
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
IPlatformMouse::SetPosition documents no exception, but TerminalMouse::SetPosition always throws PlatformException and Mouse::SetPosition calls it unguarded, so the XNA re-centre-the-cursor idiom throws once the terminal platform reports mouse input.
- Identifier
CNA-BUG-263- Category
- Bug
- Subsystem
- Input
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Low (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- Microsoft::Xna::Framework::Input::Mouse::SetPosition(int, int) on the terminal platform (TerminalMouse::SetPosition)
Expected behaviour
IPlatformMouse::SetPosition documents that it warps the pointer and that a zero window only records the position; it lists no exception, unlike SetRelativeMode, which documents PlatformNotSupportedException. XNA's Mouse.SetPosition has no failure mode for a platform that cannot warp, and CNA's own precedent for a platform without a pointer is a determinate no-op (plans/plan_platform.md PLAT-49 makes IsMouseVisible one).
Actual behaviour at TARGET
TerminalMouse::SetPosition always throws PlatformException (“SGR-1006 reports the pointer but cannot warp it”), and Mouse::SetPosition calls the platform mouse without a guard once the mouse service exists, that is, once the terminal reports mouse input. XNA code that re-centres the cursor every frame for camera control therefore throws on its first update. TerminalMouseTests.cpp pins the refusals of SetCursorVisible, SetCursor, SetRelativeMode and the global-pointer calls but has no case for SetPosition.
Source locations
modules/platform/src/Terminal/TerminalMouse.cpp— SetPosition throws PlatformExceptionmodules/platform/include/CNA/Platform/Input/IPlatformMouse.hpp— SetPosition documents no exception; SetRelativeMode documents PlatformNotSupportedExceptionmodules/input/src/Xna/Mouse.cpp— Mouse::SetPosition forwards to the platform mouse unguardedmodules/platform/tests/CNA/Platform/TerminalMouseTests.cpp— refusal cases; none for SetPosition
Evidence
Read at 009d40f5; nothing executed. Reported by the HM2 issue reviewer as a possible missing finding next to CNA-BUG-176 and re-verified by the orchestrator. Distinct from CNA-BUG-135 (the CNAEXT global-pointer trio, where the interface documents the throw) and CNA-BUG-176 (Game::IsMouseVisible).
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
The terminal mouse tests pin the other refusals directly on TerminalMouse; none exercises SetPosition or the Mouse facade on the terminal platform.
Regression test
With the terminal platform current and mouse input reported, call Mouse::SetPosition(10, 10) and expect no exception; or document the throw on IPlatformMouse::SetPosition and catch it in the facade.
Blast radius
Terminal-platform sessions whose terminal reports mouse input and whose game calls Mouse::SetPosition; other platforms warp the pointer, and a platform without a mouse service does nothing.
Workaround
Do not call Mouse::SetPosition when the active platform is the terminal, or catch PlatformException around the call.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Input: mouse
- Internals
- Terminal platform internals
- Known issues
- Bug index