Ignore events if canvas::Window is not visible
This commit is contained in:
parent
6c10f99573
commit
38ca30cbd5
3 changed files with 8 additions and 1 deletions
|
@ -345,7 +345,7 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
|
|||
static_cast<WindowUserData*>(layer->getChild(j)->getUserData())
|
||||
->window.lock();
|
||||
|
||||
if( !window->isCapturingEvents() )
|
||||
if( !window->isCapturingEvents() || !window->isVisible() )
|
||||
continue;
|
||||
|
||||
float margin = window->isResizable() ? resize_margin_pos : 0;
|
||||
|
|
|
@ -109,6 +109,12 @@ namespace canvas
|
|||
return _image.getSrcCanvas();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool Window::isVisible() const
|
||||
{
|
||||
return _image.isVisible();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool Window::isResizable() const
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue