X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fbutton.cc;h=313d8acfcf52751e0b56162444763cba6a84ec4b;hb=8269fc2b3965d12ba308caa554bfa7ee037fba13;hp=c0f48100056d0648f9e1496640ed60a8f14485b0;hpb=ef231de58a738c83bf505e184fbafa9077f7452e;p=chaz%2Fopenbox diff --git a/otk/button.cc b/otk/button.cc index c0f48100..313d8acf 100644 --- a/otk/button.cc +++ b/otk/button.cc @@ -1,8 +1,6 @@ // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -#ifdef HAVE_CONFIG_H -# include "../config.h" -#endif +#include "config.h" #include "button.hh" @@ -51,7 +49,11 @@ void Button::buttonPressHandler(const XButtonEvent &e) void Button::buttonReleaseHandler(const XButtonEvent &e) { Widget::buttonReleaseHandler(e); + bool p = _pressed; release(e.button); + if (p && !_pressed && e.x > 0 && e.y > 0 && + e.x < area().width() && e.y < area().height()) + clickHandler(_mouse_button); } void Button::styleChanged(const RenderStyle &style)