summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugingui/nativewindow_x11.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugingui/nativewindow_x11.cc b/plugingui/nativewindow_x11.cc
index 056c69f..f77a772 100644
--- a/plugingui/nativewindow_x11.cc
+++ b/plugingui/nativewindow_x11.cc
@@ -356,12 +356,15 @@ void NativeWindowX11::translateXMessage(XEvent& xevent)
{
if((xevent.xbutton.button == 4) || (xevent.xbutton.button == 5))
{
- int scroll = 1;
- auto scrollEvent = std::make_shared<ScrollEvent>();
- scrollEvent->x = xevent.xbutton.x;
- scrollEvent->y = xevent.xbutton.y;
- scrollEvent->delta = scroll * ((xevent.xbutton.button == 4) ? -1 : 1);
- event_queue.push_back(scrollEvent);
+ if(xevent.type == ButtonPress)
+ {
+ int scroll = 1;
+ auto scrollEvent = std::make_shared<ScrollEvent>();
+ scrollEvent->x = xevent.xbutton.x;
+ scrollEvent->y = xevent.xbutton.y;
+ scrollEvent->delta = scroll * ((xevent.xbutton.button == 4) ? -1 : 1);
+ event_queue.push_back(scrollEvent);
+ }
}
else if ((xevent.xbutton.button == 6) || (xevent.xbutton.button == 7))
{