openrazer's own dpi_stages active-index only updates when a stage is cycled via the mouse's physical button, not when set-dpi-stage sets d.dpi directly - so it went stale and no longer matched the real current DPI, highlighting the wrong stage regardless of what was actually applied. Derive the active stage from the current DPI value instead of trusting that index. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94