]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/CanvasWindow.cxx
Canvas: Support for preventDefault() on Events.
[simgear.git] / simgear / canvas / CanvasWindow.cxx
index f4bf38dc06ea05448149e2a82b71046e86c11103..29ef354aaae482992424289c4a26282fea84599e 100644 (file)
@@ -172,6 +172,19 @@ namespace canvas
     return _capture_events;
   }
 
+  //----------------------------------------------------------------------------
+  void Window::setVisible(bool visible)
+  {
+    LayoutItem::setVisible(visible);
+    Element::setVisible(LayoutItem::isVisible());
+  }
+
+  //----------------------------------------------------------------------------
+  bool Window::isVisible() const
+  {
+    return Element::isVisible();
+  }
+
   //----------------------------------------------------------------------------
   void Window::raise()
   {
@@ -267,6 +280,9 @@ namespace canvas
                                          ->createChild<Image>("content");
       _image_content->setSrcCanvas(content);
 
+      // Forward keyboard events to content
+      _image_content->setFocus();
+
       // Draw content on top of decoration
       _image_content->set<int>("z-index", 1);
     }