From b198fa4c2c6b804a8f2c867373482b4e9ec0f3fc Mon Sep 17 00:00:00 2001 From: hogliux Date: Mon, 3 Apr 2017 11:55:12 +0100 Subject: [PATCH] Fixed a bug on linux where the mouse pointer would jump around while dragging sliders --- .../native/juce_linux_X11_Windowing.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp index c5be8a815d..e7b059d591 100644 --- a/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp @@ -2268,13 +2268,18 @@ public: { updateKeyModifiers ((int) movedEvent.state); - lastMousePos = Point (movedEvent.x_root, movedEvent.y_root); + if ((movedEvent.state & (Button1MotionMask | Button2MotionMask + | Button3MotionMask | Button4MotionMask + | Button5MotionMask)) != 0) + { + lastMousePos = Point (movedEvent.x_root, movedEvent.y_root); - if (dragState->dragging) - handleExternalDragMotionNotify(); + if (dragState->dragging) + handleExternalDragMotionNotify(); - handleMouseEvent (MouseInputSource::InputSourceType::mouse, getMousePos (movedEvent), currentModifiers, - MouseInputSource::invalidPressure, MouseInputSource::invalidOrientation, getEventTime (movedEvent)); + handleMouseEvent (MouseInputSource::InputSourceType::mouse, getMousePos (movedEvent), currentModifiers, + MouseInputSource::invalidPressure, MouseInputSource::invalidOrientation, getEventTime (movedEvent)); + } } void handleEnterNotifyEvent (const XEnterWindowEvent& enterEvent)