From 87e3a71580b5efccb2ff79c6cf9ffe4ef93401fb Mon Sep 17 00:00:00 2001 From: stephena Date: Sat, 28 May 2011 01:14:14 +0000 Subject: [PATCH] Fix bug with unwanted mouse movement after changing video modes. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2239 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/emucore/EventHandler.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index e2e46264f..8d0dd152e 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -646,8 +646,12 @@ void EventHandler::poll(uInt64 time) if(myMouseEnabled) { int x = event.motion.xrel, y = event.motion.yrel; - myEvent->set(Event::MouseAxisXValue, x); - myEvent->set(Event::MouseAxisYValue, y); + // Filter out extremely large movement, which is usually caused + // by a screen being re-created + if(abs(x) < 100) + myEvent->set(Event::MouseAxisXValue, x); + if(abs(y) < 100) + myEvent->set(Event::MouseAxisYValue, y); } } else if(myOverlay)