X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=otk%2Fbutton.cc;h=3f283b00085ac9869a7e0d3b661995a34ede48ff;hb=7df3b620e21777dbefa24f381c1a95fafed1c16e;hp=410f00838bcf37eb7179ad0e8b978a4e15855eaa;hpb=0856b11de843db30b5053c8cb7d9c84eae262852;p=chaz%2Fopenbox diff --git a/otk/button.cc b/otk/button.cc index 410f0083..3f283b00 100644 --- a/otk/button.cc +++ b/otk/button.cc @@ -1,3 +1,4 @@ +#include #include "button.hh" namespace otk { @@ -66,16 +67,33 @@ void OtkButton::update(void) _dirty = false; } -bool OtkButton::expose(const XExposeEvent &e) +int OtkButton::buttonPressHandler(const XButtonEvent &e) { + press(); _dirty = true; - return OtkFocusWidget::expose(e); + update(); + return OtkFocusWidget::buttonPressHandler(e); } -bool OtkButton::configure(const XConfigureEvent &e) +int OtkButton::buttonReleaseHandler(const XButtonEvent &e) { + release(); _dirty = true; - return OtkFocusWidget::configure(e); + update(); + return OtkFocusWidget::buttonReleaseHandler(e); +} + +int OtkButton::exposeHandler(const XExposeEvent &e) +{ + _dirty = true; + return OtkFocusWidget::exposeHandler(e); +} + +int OtkButton::configureHandler(const XConfigureEvent &e) +{ + if (!(e.width == width() && e.height == height())) + _dirty = true; + return OtkFocusWidget::configureHandler(e); } }