summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2019-01-27 21:10:30 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2019-01-27 21:10:30 +0100
commitf3fa39437c711f75949fbe0056007e343a428062 (patch)
tree11333bc15a9ec967d40966e99eb0211a4b2a9a4d /plugingui
parent2aae9799e1d96d827ad156aeafa549deabd51e5d (diff)
Fix double firering of scroll events.
Diffstat (limited to 'plugingui')
-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))
{