From a97fb3024da290b6f59aa2983c8a659ac26b6fa0 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 12 Feb 2013 12:13:29 +0000 Subject: [PATCH] Linux mouse-drag fix. --- .../native/juce_linux_Windowing.cpp | 36 +++---------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp index 4cddf5af71..e183bf6d7b 100644 --- a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp @@ -1519,41 +1519,13 @@ public: void handleMotionNotifyEvent (const XPointerMovedEvent& movedEvent) { updateKeyModifiers (movedEvent.state); - const Point mousePos (movedEvent.x_root, movedEvent.y_root); - if (lastMousePos != mousePos) - { - lastMousePos = mousePos; - - if (parentWindow != 0 && (styleFlags & windowHasTitleBar) == 0) - { - Window wRoot = 0, wParent = 0; - - { - ScopedXLock xlock; - unsigned int numChildren; - Window* wChild = nullptr; - XQueryTree (display, windowH, &wRoot, &wParent, &wChild, &numChildren); - } - - if (wParent != 0 - && wParent != windowH - && wParent != wRoot) - { - parentWindow = wParent; - updateBounds(); - } - else - { - parentWindow = 0; - } - } + lastMousePos = Point (movedEvent.x_root, movedEvent.y_root); - if (dragState.dragging) - handleExternalDragMotionNotify(); + if (dragState.dragging) + handleExternalDragMotionNotify(); - handleMouseEvent (0, mousePos - getScreenPosition(), currentModifiers, getEventTime (movedEvent)); - } + handleMouseEvent (0, getMousePos (movedEvent), currentModifiers, getEventTime (movedEvent)); } void handleEnterNotifyEvent (const XEnterWindowEvent& enterEvent)