get rid of mouse warping

This commit is contained in:
Tim Felgentreff 2020-04-19 22:32:00 +02:00
parent 96f0360d29
commit 6982abfba1

View file

@ -493,19 +493,8 @@ static void SdlDoEvent(const EventCallback &callbacks, SDL_Event &event)
InputMouseButtonRelease(callbacks, SDL_GetTicks(), event.button.button);
break;
// FIXME: check if this is only useful for the cursor
// FIXME: if this is the case we don't need this.
case SDL_MOUSEMOTION:
InputMouseMove(callbacks, SDL_GetTicks(), event.motion.x, event.motion.y);
// FIXME: Same bug fix from X11
if ((UI.MouseWarpPos.x != -1 || UI.MouseWarpPos.y != -1)
&& (event.motion.x != UI.MouseWarpPos.x || event.motion.y != UI.MouseWarpPos.y)) {
int xw = UI.MouseWarpPos.x;
int yw = UI.MouseWarpPos.y;
UI.MouseWarpPos.x = -1;
UI.MouseWarpPos.y = -1;
SDL_WarpMouseInWindow(TheWindow, xw, yw);
}
break;
case SDL_WINDOWEVENT: