1
0
Fork 0

Ignore events if canvas::Window is not visible

This commit is contained in:
Thomas Geymayer 2013-02-13 12:10:25 +01:00
parent 6c10f99573
commit 38ca30cbd5
3 changed files with 8 additions and 1 deletions

View file

@ -345,7 +345,7 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
static_cast<WindowUserData*>(layer->getChild(j)->getUserData()) static_cast<WindowUserData*>(layer->getChild(j)->getUserData())
->window.lock(); ->window.lock();
if( !window->isCapturingEvents() ) if( !window->isCapturingEvents() || !window->isVisible() )
continue; continue;
float margin = window->isResizable() ? resize_margin_pos : 0; float margin = window->isResizable() ? resize_margin_pos : 0;

View file

@ -109,6 +109,12 @@ namespace canvas
return _image.getSrcCanvas(); return _image.getSrcCanvas();
} }
//----------------------------------------------------------------------------
bool Window::isVisible() const
{
return _image.isVisible();
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool Window::isResizable() const bool Window::isResizable() const
{ {

View file

@ -56,6 +56,7 @@ namespace canvas
void setCanvas(simgear::canvas::CanvasPtr canvas); void setCanvas(simgear::canvas::CanvasPtr canvas);
simgear::canvas::CanvasWeakPtr getCanvas() const; simgear::canvas::CanvasWeakPtr getCanvas() const;
bool isVisible() const;
bool isResizable() const; bool isResizable() const;
bool isCapturingEvents() const; bool isCapturingEvents() const;