smarter expose. stop when the window is found
Dana Jansens danakj@orodu.net
4 files changed,
9 insertions(+),
6 deletions(-)
M
otk/widget.cc
→
otk/widget.cc
@@ -390,16 +390,19 @@ if (it != _children.end())
_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; } }
M
otk/widget.hh
→
otk/widget.hh
@@ -27,7 +27,7 @@ virtual ~OtkWidget();
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; }