From d9a6491a43cf346a916268ef35395a9029c3e538 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 12 Jun 2014 16:00:21 +0000 Subject: [PATCH] Removed generation of scroll event on the X11 button release event as X11 was generating both a pair of press/release events for a single scroll when movement. git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14257 16af8721-9629-0410-8352-f15c8da7e697 --- src/osgViewer/GraphicsWindowX11.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index e4762feb7..42148ee36 100644 --- a/src/osgViewer/GraphicsWindowX11.cpp +++ b/src/osgViewer/GraphicsWindowX11.cpp @@ -1476,11 +1476,13 @@ bool GraphicsWindowX11::checkEvents() if( ev.xbutton.button == Button4 ) { - getEventQueue()->mouseScroll(osgGA::GUIEventAdapter::SCROLL_UP, eventTime); + //ignore scroll release as X11 is generating button press and release pairs for scroll wheel motion and we only need only event for each scroll action + //getEventQueue()->mouseScroll(osgGA::GUIEventAdapter::SCROLL_UP, eventTime); } else if( ev.xbutton.button == Button5) { - getEventQueue()->mouseScroll(osgGA::GUIEventAdapter::SCROLL_DOWN, eventTime); + //ignore scroll release as X11 is generating button press and release pairs for scroll wheel motion and we only need only event for each scroll action + //getEventQueue()->mouseScroll(osgGA::GUIEventAdapter::SCROLL_DOWN, eventTime); } else { @@ -1564,7 +1566,7 @@ bool GraphicsWindowX11::checkEvents() requestRedraw(); } } - + return !(getEventQueue()->empty()); } @@ -2173,7 +2175,7 @@ void GraphicsWindowX11::raiseWindow() xev.xclient.data.l[0] = 1; xev.xclient.data.l[1] = stateAbove; xev.xclient.data.l[2] = 0; - + XSendEvent(display, RootWindow(display, DefaultScreen(display)), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); }