all repos — openbox @ e07ea8486556349ee0a312fd4c6bc0e5aa2de4f9

openbox fork - make it a bit more like ryudo

only fire the clickHandler if the button is released with the cursor over it
Dana Jansens danakj@orodu.net
commit

e07ea8486556349ee0a312fd4c6bc0e5aa2de4f9

parent

bbd9cb9928e5009ef6f3a91278ec6091343c9353

1 files changed, 4 insertions(+), 2 deletions(-)

jump to
M otk/button.ccotk/button.cc

@@ -38,8 +38,6 @@ _pressed = false;

styleChanged(*RenderStyle::style(screen())); refresh(); - - clickHandler(_mouse_button); } void Button::buttonPressHandler(const XButtonEvent &e)

@@ -51,7 +49,11 @@

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)