From: Thomas Geymayer Date: Mon, 13 Aug 2012 11:59:45 +0000 (+0200) Subject: Canvas: Bugfixes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=875b59952bd726fc0a15ed516ff5fd95147d590e;p=flightgear.git Canvas: Bugfixes - Fix dependency cycle - Correctly forward mouse release event --- diff --git a/src/Canvas/gui_mgr.cxx b/src/Canvas/gui_mgr.cxx index 4fa66febd..f11cc3296 100644 --- a/src/Canvas/gui_mgr.cxx +++ b/src/Canvas/gui_mgr.cxx @@ -90,7 +90,7 @@ class WindowUserData: public osg::Referenced { public: - canvas::WindowPtr window; + canvas::WindowWeakPtr window; WindowUserData(canvas::WindowPtr window): window(window) {} @@ -277,7 +277,8 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea) { assert(layer->getChild(j)->getUserData()); canvas::WindowPtr window = - static_cast(layer->getChild(j)->getUserData())->window; + static_cast(layer->getChild(j)->getUserData()) + ->window.lock(); if( window->getRegion().contains(event.x, event.y) ) { window_at_cursor = window; @@ -300,9 +301,6 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea) break; case osgGA::GUIEventAdapter::RELEASE: - if( !_last_push.expired() ) - return false; - target_window = _last_push.lock(); _last_push.reset(); break;