diff --git a/include/osgViewer/GraphicsWindowX11 b/include/osgViewer/GraphicsWindowX11 index 4f3eaa45e..f21318ff3 100644 --- a/include/osgViewer/GraphicsWindowX11 +++ b/include/osgViewer/GraphicsWindowX11 @@ -44,7 +44,8 @@ class GraphicsWindowX11 : public osgViewer::GraphicsWindow _nullCursor(0), _currentCursor(0), _initialized(false), - _realized(false) + _realized(false), + _timeOfLastCheckEvents(-1.0) { _traits = traits; @@ -129,6 +130,8 @@ class GraphicsWindowX11 : public osgViewer::GraphicsWindow bool _initialized; bool _realized; + + double _timeOfLastCheckEvents; }; } diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index ecf7dcc44..9cbcd7c51 100644 --- a/src/osgViewer/GraphicsWindowX11.cpp +++ b/src/osgViewer/GraphicsWindowX11.cpp @@ -612,12 +612,19 @@ void GraphicsWindowX11::checkEvents() { if (!_realized) return; + double baseTime = _timeOfLastCheckEvents; + double eventTime = baseTime; + double resizeTime = eventTime; + _timeOfLastCheckEvents = getEventQueue()->getTime(); + int windowX = _traits->x; int windowY = _traits->y; int windowWidth = _traits->width; int windowHeight = _traits->height; bool destroyWindowRequested = false; + + Time firstEventTime = 0; // osg::notify(osg::NOTICE)<<"Check events"<