Mouse capture release: always put the cursor at the centre of the viewer window, from every capture source #871

Open
opened 2026-10-19 14:55:43 +00:00 by sky_line · 0 comments
Owner

When the viewer stops capturing / hiding the mouse, the cursor should reappear at the centre of the viewer window, consistently, whatever started the capture. Today each capture source restores the cursor its own way (to the press point, to wherever the OS left it, or not at all), so the cursor turns up in different places.

Capture sources to cover (audit -- all call sites that hide / warp / restore the cursor)

  • Mouselook exit (llagentcamera.cpp, lltoolgun.cpp, llviewermenu.cpp).
  • Right-click hold orbit and avatar orbit, #861 / #862 (lltoolpie.cpp endRightOrbit()): changes the current "return to the press point" behaviour to centre.
  • Third-person shooter camera release (sltpscamera.cpp).
  • Alt / camera-tool orbit and pan with the cursor hidden (lltoolfocus.cpp).
  • Object grab / spin drag (lltoolgrab.cpp).
  • 3D mouse / joystick navigation (slmmbnav.cpp).
  • Any other hideCursor / showCursor / setCursorPosition / moveCursorToCenter users (llviewerwindow.cpp, lltoolmgr.cpp, lltoolcomp.cpp, llagent.cpp, RLV). Map / minimap / preview-floater drags are panning inside a widget and are probably out of scope; decide per site and note it.

Implementation

  • One helper (e.g. on LLViewerWindow) that every release path calls: show the cursor and warp it to the window centre. Remove per-site restore logic instead of layering on it.
  • Also on involuntary release: focus loss, alt-tab, minimise, tool switch, teleport / disconnect while captured -- the cursor must come back visible and centred (or, if the window lost focus, visible when focus returns).
  • Optional setting if anyone wants the old behaviour (e.g. MouseReleaseToCenter, Boolean, default on) -- decide during implementation; default is centre.

Acceptance

  • Leaving mouselook, ending a right-click orbit (both #861 and #862 modes), releasing the TPS camera, ending an alt-orbit or grab drag: cursor visible at window centre every time.
  • Alt-tab / focus loss during any capture: cursor never left hidden or stuck.
  • Works with HiDPI scaling and on Windows and Linux (SDL window).
When the viewer stops capturing / hiding the mouse, the cursor should reappear at the **centre of the viewer window**, consistently, whatever started the capture. Today each capture source restores the cursor its own way (to the press point, to wherever the OS left it, or not at all), so the cursor turns up in different places. ## Capture sources to cover (audit -- all call sites that hide / warp / restore the cursor) - Mouselook exit (`llagentcamera.cpp`, `lltoolgun.cpp`, `llviewermenu.cpp`). - Right-click hold orbit and avatar orbit, #861 / #862 (`lltoolpie.cpp` `endRightOrbit()`): **changes the current "return to the press point" behaviour to centre.** - Third-person shooter camera release (`sltpscamera.cpp`). - Alt / camera-tool orbit and pan with the cursor hidden (`lltoolfocus.cpp`). - Object grab / spin drag (`lltoolgrab.cpp`). - 3D mouse / joystick navigation (`slmmbnav.cpp`). - Any other `hideCursor` / `showCursor` / `setCursorPosition` / `moveCursorToCenter` users (`llviewerwindow.cpp`, `lltoolmgr.cpp`, `lltoolcomp.cpp`, `llagent.cpp`, RLV). Map / minimap / preview-floater drags are panning inside a widget and are probably out of scope; decide per site and note it. ## Implementation - One helper (e.g. on `LLViewerWindow`) that every release path calls: show the cursor and warp it to the window centre. Remove per-site restore logic instead of layering on it. - Also on involuntary release: focus loss, alt-tab, minimise, tool switch, teleport / disconnect while captured -- the cursor must come back visible and centred (or, if the window lost focus, visible when focus returns). - Optional setting if anyone wants the old behaviour (e.g. `MouseReleaseToCenter`, Boolean, default on) -- decide during implementation; default is centre. ## Acceptance - Leaving mouselook, ending a right-click orbit (both #861 and #862 modes), releasing the TPS camera, ending an alt-orbit or grab drag: cursor visible at window centre every time. - Alt-tab / focus loss during any capture: cursor never left hidden or stuck. - Works with HiDPI scaling and on Windows and Linux (SDL window).
sky_line added this to the Slipstream project 2026-10-19 14:55:43 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#871
No description provided.