summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FbTk/Button.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/FbTk/Button.cc b/src/FbTk/Button.cc
index 9edbe5c..f38c20b 100644
--- a/src/FbTk/Button.cc
+++ b/src/FbTk/Button.cc
@@ -128,9 +128,10 @@ void Button::buttonReleaseEvent(XButtonEvent &event) {
128 // hence the mark_if_deleted mechanism so that we can 128 // hence the mark_if_deleted mechanism so that we can
129 // update our state after the command 129 // update our state after the command
130 if (event.button > 0 && event.button <= 5 && 130 if (event.button > 0 && event.button <= 5 &&
131 // I'm not quite sure why we get events with e.g. y == height, but we do 131 event.x >= -static_cast<signed>(borderWidth()) &&
132 event.x >= 0 && event.x <= static_cast<signed>(width()) && 132 event.x <= static_cast<signed>(width()+borderWidth()) &&
133 event.y >= 0 && event.y <= static_cast<signed>(height()) && 133 event.y >= -static_cast<signed>(borderWidth()) &&
134 event.y <= static_cast<signed>(height()+borderWidth()) &&
134 m_onclick[event.button -1].get() != 0) 135 m_onclick[event.button -1].get() != 0)
135 m_onclick[event.button - 1]->execute(); 136 m_onclick[event.button - 1]->execute();
136 137