Fix mouse handler moving OS pen cursor
- Fixes https://github.com/ppy/osu/issues/31948, not sure why the original author closed.
I've had this issue for a while, and just found out that the new PenHandler was the culprit.
Whenever PenHandler moves the cursor, MouseHandler tries to forcefully move the cursor to the reported position because it is not self-feedback, but SDL3 PenHandler also represents OS cursor.
I think the process here is like: Pen reports a position -> PenHandler becomes mouseSource -> MouseHandler moves the OS cursor -> Pen moves -> OS cursor gets repositioned -> Pen somehow reports the forcefully moved position? -> Cursor is now stuck
I don't have a tablet driver installed on my Windows installation, so it's only tested on Linux. This is somehow only reproducible on X11 for me. The issue author was probably using Xwayland. Honestly, I don't know how moving a cursor (SDL_WarpMouseInWindow) is affecting an absolute positioning device, but I don't really want to dig deeper.
I'm not sure if isSelfFeedback is needed anymore, but I just focused on fixing the issue. Please tell me if there's a better way to fix it!
This pr works for me. Sorry for the confusion earlier, i was under the wrong impression.
FeedbackMousePositionChange() is working as intended here. It's whole purpose is to position the OS cursor to the OTD / SDL pen position. For reference, it works fine on Windows+OTD with high precision mouse disabled.
OS cursor gets repositioned -> Pen somehow reports the forcefully moved position?
This seems like a bug in SDL or your desktop environment. We are calling SDL_WarpMouseInWindow(), it should not affect the pen position.
Please enable SDL_EVENT_LOGGING=2, add logging to handleMouseMotionEvent() and provide the full logs. I guess you can put the logs in the issue thread https://github.com/ppy/osu/issues/31948.
https://github.com/ppy/osu/issues/31948#issuecomment-2674850214