From 8e8b2bba04107924cf4b1c80e0604e7f9db9457b Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 16 Feb 2006 21:02:09 +0000 Subject: [PATCH] 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. --- src/Main/fg_os_sdl.cxx | 3 +++ 1 file changed, 3 insertions(+) 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); }