CNA-BUG-135: Mouse::SetCaptureEXT, GetGlobalPositionEXT and WarpGlobalEXT let PlatformNotSupportedException escape 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 c1c316b9; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
The terminal mouse service throws PlatformNotSupportedException from SetCapture, TryGetGlobalPosition and SetGlobalPosition, and the Mouse wrappers do not catch it, although they document false (or (0, 0)) for an unsupported platform.
- Identifier
CNA-BUG-135- Category
- Bug
- Subsystem
- Input
- Status
- Open
- Verified against
- CNA
c1c316b9(c1c316b9c7a846ce8002809c151fcd1af14942c9) - 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
- Mouse::SetCaptureEXT(bool), Mouse::GetGlobalPositionEXT(int&, int&), Mouse::WarpGlobalEXT(int, int)
Expected behaviour
Mouse.hpp documents SetCaptureEXT and WarpGlobalEXT as returning false “if the platform does not support” the operation, and GetGlobalPositionEXT in Mouse.cpp zeroes its outputs first “so a platform with no desktop pointer answers (0, 0)”.
Actual behaviour at TARGET
The wrappers call the platform mouse directly. TerminalMouse (TerminalMouse.cpp) throws PlatformNotSupportedException from all three methods, as IPlatformMouse.hpp allows (“@throws PlatformNotSupportedException If the platform reports no GlobalPointer capability”). The exception reaches the game. The SDL3 platform answers through SDL on every video driver, and the headless platform has no mouse service, so the wrappers return their documented defaults there.
Source locations
modules/input/src/Xna/Mouse.cpp— Mouse::SetCaptureEXT, GetGlobalPositionEXT, WarpGlobalEXT: no capability check, no catchmodules/input/include/Microsoft/Xna/Framework/Input/Mouse.hpp— documented false return for unsupported platformsmodules/platform/src/Terminal/TerminalMouse.cpp— SetCapture, TryGetGlobalPosition, SetGlobalPosition throwmodules/platform/include/CNA/Platform/Input/IPlatformMouse.hpp— @throws PlatformNotSupportedException contract
Evidence
Checked by reading at c1c316b9; not executed on a terminal.
Focused reproduction
// Illustrative; not compiled or run. CNA_PLATFORM=TERMINAL.
int x = 0, y = 0;
Mouse::GetGlobalPositionEXT(x, y); // expected (0, 0); actual: PlatformNotSupportedException
Current tests
TheRealPlatformIsSafeForAllThree in MouseGlobalTests.cpp asserts no throw on the test platform only; the throwing backends are not driven through the wrappers.
Regression test
The same test against a canned mouse whose three methods throw PlatformNotSupportedException; the fix is a GlobalPointer capability check (or a catch) in the three wrappers.
Blast radius
Games calling the three CNAEXT mouse functions on the terminal platform. SDL3 (on every video driver) and headless answer normally.
Workaround
Catch PlatformNotSupportedException around the calls, or check the platform's GlobalPointer capability first.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Input: mouse
- Internals
- Input internals: mouse
- Deep dives
- Input model: logical coordinates
- Known issues
- Bug index