]> git.mxchange.org Git - flightgear.git/commitdiff
Fix cursor hide timeout if hovering on canvas windows
authorThomas Geymayer <tomgey@gmail.com>
Fri, 21 Jun 2013 19:59:58 +0000 (21:59 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Fri, 21 Jun 2013 20:00:09 +0000 (22:00 +0200)
src/Canvas/gui_mgr.cxx
src/Input/FGMouseInput.cxx
src/Viewer/FGEventHandler.cxx

index d55ff3a653ebb3fd938148eb7c57beb217aa3437..cfee29c0747a1cf3419cae75566320f1693a2b90 100644 (file)
@@ -48,7 +48,7 @@ class GUIEventHandler:
     {}
 
     bool handle( const osgGA::GUIEventAdapter& ea,
-                 osgGA::GUIActionAdapter& aa,
+                 osgGA::GUIActionAdapter&,
                  osg::Object*,
                  osg::NodeVisitor* )
     {
index 218b3342b727b1e95b3486b24c7f37434c14e681..6ac4c0e9827a4966a532307ad5295d6719787a58 100644 (file)
@@ -689,6 +689,10 @@ void FGMouseInput::doMouseMotion (int x, int y, const osgGA::GUIEventAdapter* ea
   m.timeSinceLastMove.stamp();
   FGMouseCursor::instance()->mouseMoved();
 
+  // TODO Get rid of this as soon as soon as cursor hide timeout works globally
+  if( ea->getHandled() )
+    return;
+
   processMotion(x, y, ea);
     
   m.x = x;
index c0978b1648807ce7dc6e4a27e765925569613095..c3bf622e0468930b093b749599080392f6f89ade 100644 (file)
@@ -185,7 +185,14 @@ bool FGEventHandler::handle(const osgGA::GUIEventAdapter& ea,
     // Event handlers seem to be called even if the according event has already
     // been handled. Already handled events shouldn't be handled multiple times
     // so we need to exit here manually.
-    if( ea.getHandled() )
+    if(    ea.getHandled()
+           // Let mouse move events pass to correctly handle mouse cursor hide
+           // timeout while moving just on the canvas gui.
+           // TODO We should clean up the whole mouse input and make hide
+           //      timeout independent of the event handler which consumed the
+           //      event.
+        && ea.getEventType() != osgGA::GUIEventAdapter::MOVE
+        && ea.getEventType() != osgGA::GUIEventAdapter::DRAG )
       return false;
 
     int x = 0;