diff --git a/src/Canvas/gui_mgr.cxx b/src/Canvas/gui_mgr.cxx index 160671eff..91424d9b2 100644 --- a/src/Canvas/gui_mgr.cxx +++ b/src/Canvas/gui_mgr.cxx @@ -345,7 +345,7 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea) static_cast(layer->getChild(j)->getUserData()) ->window.lock(); - if( !window->isCapturingEvents() ) + if( !window->isCapturingEvents() || !window->isVisible() ) continue; float margin = window->isResizable() ? resize_margin_pos : 0; diff --git a/src/Canvas/window.cxx b/src/Canvas/window.cxx index e47535bfc..126212aa7 100644 --- a/src/Canvas/window.cxx +++ b/src/Canvas/window.cxx @@ -109,6 +109,12 @@ namespace canvas return _image.getSrcCanvas(); } + //---------------------------------------------------------------------------- + bool Window::isVisible() const + { + return _image.isVisible(); + } + //---------------------------------------------------------------------------- bool Window::isResizable() const { diff --git a/src/Canvas/window.hxx b/src/Canvas/window.hxx index 00eb58737..44bfafaea 100644 --- a/src/Canvas/window.hxx +++ b/src/Canvas/window.hxx @@ -56,6 +56,7 @@ namespace canvas void setCanvas(simgear::canvas::CanvasPtr canvas); simgear::canvas::CanvasWeakPtr getCanvas() const; + bool isVisible() const; bool isResizable() const; bool isCapturingEvents() const;