From d4b48cec5d5cd91607657adb17e7ad9c60349bdf Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Sat, 29 Jun 2013 14:29:38 +0200 Subject: [PATCH] Canvas: clear mousedown/click if mouse leaves canvas. --- simgear/canvas/CanvasEventManager.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/simgear/canvas/CanvasEventManager.cxx b/simgear/canvas/CanvasEventManager.cxx index 3d14ea56..6a6f7cf2 100644 --- a/simgear/canvas/CanvasEventManager.cxx +++ b/simgear/canvas/CanvasEventManager.cxx @@ -112,6 +112,13 @@ namespace canvas case Event::MOUSE_LEAVE: // Mouse leaves window and therefore also current mouseover element handleMove(event, EventPropagationPath()); + + // Event is only send if mouse is moved outside the window or dragging + // has ended somewhere outside the window. In both cases a mouse button + // has been released, so no more mouse down or click... + _last_mouse_down.clear(); + _last_click.clear(); + return true; case Event::WHEEL: break; -- 2.39.5