We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3970

Summary: Sticky cursor on the borders with the Raspberry Pi and KMSDRM backends
Product: SDL Reporter: Manuel Alfayate Corchete <redwindwanderer>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 2.0.7   
Hardware: All   
OS: Linux   
Attachments: Testcase for the "sticky borders" problem on the Raspberry Pi

Description Manuel Alfayate Corchete 2017-11-17 23:08:44 UTC
Hi,

I noticed the mouse cursor is sticky on the borders on current ScummVM GIT versions (due for major release soon, so it should be fixed).

The cause is well known to me:
WarpMouse will position the mouse on the border, BUT it won't update the coordinates internally.

The function that does that internal update is SDL_SendMouseMotion.

Both Raspberry Pi and KMSDRM backends are missing an importan SDL_SendMouseMotion() call at the end of their WarpMouse implementations.
I was going to do a fast fix for this, but I can't because the SDL_SendMouseMotion() calls I do always end up segfaulting and I can't find the cause...

I have tried adding:
SDL_SendMouseMotion(win, mouse->mouseID, 0, x, y);

at the end of RPI_WarpMouse(), after I call SDL_GetMouse() to retrieve de mouse, with no success (segfault). Also tried other points in the code, with the same fate.

Any help is welcome.
Comment 1 Manuel Alfayate Corchete 2017-11-17 23:24:35 UTC
Created attachment 3089 [details]
Testcase for the "sticky borders" problem on the Raspberry Pi

I have added this small testcase where you can see how the internal coordinates are NOT being updated on the SDL_WarpMouseInWindow() if your run it on a Raspberry Pi, but it they are updated on X11, Mac, etc... so you can see a call to SDL_SendMouseMotion() on RPI_WarpMouse() is needed.
Comment 2 Manuel Alfayate Corchete 2017-11-20 11:51:33 UTC
Please close this, it's fixed by:
https://bugzilla.libsdl.org/show_bug.cgi?id=3974
Comment 3 Manuel Alfayate Corchete 2017-12-08 12:40:49 UTC
This can be closed, as the bug producing it is already fixed.