From: mfranz Date: Thu, 16 Feb 2006 21:02:09 +0000 (+0000) Subject: in fgWarpMouse() we need to flush all mouse motion events before we can set X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8e8b2bba04107924cf4b1c80e0604e7f9db9457b;p=flightgear.git in fgWarpMouse() we need to flush all mouse motion events before we can set the mouse pointer to a new position. Otherwise it can happen that the new position is first set, but then come a few still unprocessed events for the old position. This makes ugly jumps in mouse view mode. --- diff --git a/src/Main/fg_os_sdl.cxx b/src/Main/fg_os_sdl.cxx index 16ab62d22..58602a884 100644 --- a/src/Main/fg_os_sdl.cxx +++ b/src/Main/fg_os_sdl.cxx @@ -241,6 +241,9 @@ int fgGetKeyModifiers() void fgWarpMouse(int x, int y) { + SDL_Event e[10]; + SDL_PumpEvents(); + SDL_PeepEvents(e, 10, SDL_GETEVENT, SDL_MOUSEMOTIONMASK); SDL_WarpMouse(x, y); }