1
0
Fork 0

Fix cursor hide timeout if hovering on canvas windows

This commit is contained in:
Thomas Geymayer 2013-06-21 21:59:58 +02:00
parent 4bcf209dc8
commit 0239e9c8c8
3 changed files with 13 additions and 2 deletions

View file

@ -48,7 +48,7 @@ class GUIEventHandler:
{}
bool handle( const osgGA::GUIEventAdapter& ea,
osgGA::GUIActionAdapter& aa,
osgGA::GUIActionAdapter&,
osg::Object*,
osg::NodeVisitor* )
{

View 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;

View 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;