]> git.mxchange.org Git - flightgear.git/commitdiff
Ignore events if canvas::Window is not visible
authorThomas Geymayer <tomgey@gmail.com>
Wed, 13 Feb 2013 11:10:25 +0000 (12:10 +0100)
committerThomas Geymayer <tomgey@gmail.com>
Wed, 13 Feb 2013 11:10:25 +0000 (12:10 +0100)
src/Canvas/gui_mgr.cxx
src/Canvas/window.cxx
src/Canvas/window.hxx

index 160671eff0f7abad68662ed68d477c1b102aac1e..91424d9b2da5a5e9b6b4f65f299304c5947fe18e 100644 (file)
@@ -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;
index e47535bfcb81b870abb420f1ceb0d9bd17e13cd9..126212aa758f58aec3d929ed86d2e0b016fa693e 100644 (file)
@@ -109,6 +109,12 @@ namespace canvas
     return _image.getSrcCanvas();
   }
 
+  //----------------------------------------------------------------------------
+  bool Window::isVisible() const
+  {
+    return _image.isVisible();
+  }
+
   //----------------------------------------------------------------------------
   bool Window::isResizable() const
   {
index 00eb58737e7f7da4732f0a0fb02741425e0f0b08..44bfafaea61d4a5a8c072a7631360baa7ff758c4 100644 (file)
@@ -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;