]> git.mxchange.org Git - flightgear.git/commitdiff
in fgWarpMouse() we need to flush all mouse motion events before we can set
authormfranz <mfranz>
Thu, 16 Feb 2006 21:02:09 +0000 (21:02 +0000)
committermfranz <mfranz>
Thu, 16 Feb 2006 21:02:09 +0000 (21:02 +0000)
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

index 16ab62d22f0ef2ac9ace1b4c4336caccc5bc0d22..58602a884b9922c01b0ca2587a8ec9483436b9b7 100644 (file)
@@ -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);
 }