Don't interpret raw input messages with no mouse position
authorSam Lantinga
Tue, 07 Apr 2020 09:18:19 -0700
changeset 13695775d08dd98db
parent 13694 a76372587774
child 13696 ea20a7434b98
Don't interpret raw input messages with no mouse position

This happens occasionally on touch devices when raw input is enabled
src/video/windows/SDL_windowsevents.c
     1.1 --- a/src/video/windows/SDL_windowsevents.c	Mon Apr 06 19:21:56 2020 -0700
     1.2 +++ b/src/video/windows/SDL_windowsevents.c	Tue Apr 07 09:18:19 2020 -0700
     1.3 @@ -609,7 +609,7 @@
     1.4  
     1.5                      if ((rawmouse->usFlags & 0x01) == MOUSE_MOVE_RELATIVE) {
     1.6                          SDL_SendMouseMotion(data->window, 0, 1, (int)rawmouse->lLastX, (int)rawmouse->lLastY);
     1.7 -                    } else {
     1.8 +                    } else if (rawmouse->lLastX || rawmouse->lLastY) {
     1.9                          /* synthesize relative moves from the abs position */
    1.10                          static SDL_Point lastMousePoint;
    1.11                          SDL_bool virtual_desktop = (rawmouse->usFlags & MOUSE_VIRTUAL_DESKTOP) ? SDL_TRUE : SDL_FALSE;