]> Dogcows Code - chaz/openbox/commitdiff
smarter expose. stop when the window is found
authorDana Jansens <danakj@orodu.net>
Fri, 15 Nov 2002 02:40:57 +0000 (02:40 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 15 Nov 2002 02:40:57 +0000 (02:40 +0000)
otk/button.cc
otk/button.hh
otk/widget.cc
otk/widget.hh

index 9d6c43b13d4b63de621a2cb05a5d9be7f09deb96..150e32d9369c47ea40944cf92e979cda69affd15 100644 (file)
@@ -65,10 +65,10 @@ void OtkButton::update(void)
     OtkFocusWidget::update();
 }
 
-void OtkButton::expose(const XExposeEvent &e)
+bool OtkButton::expose(const XExposeEvent &e)
 {
   _dirty = true;
-  OtkFocusWidget::expose(e);
+  return OtkFocusWidget::expose(e);
 }
 
 }
index a4b3a978763a7685b5df854d1231f910839b7a2a..48a0f8136df861bc8b3d68bb9d3225e428a89f44 100644 (file)
@@ -34,7 +34,7 @@ public:
   void release(void);
 
   virtual void update(void);
-  virtual void expose(const XExposeEvent &e);
+  virtual bool expose(const XExposeEvent &e);
 
 private:
 
index aaec59b60ec35044e9623c596226d8c0b50b0d92..3ff484bca546dd0b36a6b72792530cafb77fd3fc 100644 (file)
@@ -390,16 +390,19 @@ void OtkWidget::removeChild(OtkWidget *child)
     _children.erase(it);
 }
 
-void OtkWidget::expose(const XExposeEvent &e)
+bool OtkWidget::expose(const XExposeEvent &e)
 {
   if (e.window == _window) {
     _dirty = true;
     update();
+    return true;
   } else {
     OtkWidgetList::iterator it = _children.begin(), end = _children.end();
     for (; it != end; ++it)
-      (*it)->expose(e);
+      if ((*it)->expose(e))
+        return true;
   }
+  return false;
 }
 
 }
index 21e2911aafb2abd61f889eb6d3fc1d5369e6e06b..ca65730c1a5b795800bfde0e34f983f203c48297 100644 (file)
@@ -27,7 +27,7 @@ public:
 
   virtual void update(void);
 
-  virtual void expose(const XExposeEvent &e);
+  virtual bool expose(const XExposeEvent &e);
 
   inline Window getWindow(void) const { return _window; }
   inline const OtkWidget *getParent(void) const { return _parent; }
This page took 0.025132 seconds and 4 git commands to generate.