From 8679fd20b1a8ddd2858922b3cd3d34d3b53dc065 Mon Sep 17 00:00:00 2001
From: fluxgen <fluxgen>
Date: Mon, 8 Sep 2003 15:37:37 +0000
Subject: fixed minor bug

---
 src/FbTk/Button.cc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/FbTk/Button.cc b/src/FbTk/Button.cc
index ed1a920..5e3c0ec 100644
--- a/src/FbTk/Button.cc
+++ b/src/FbTk/Button.cc
@@ -19,7 +19,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Button.cc,v 1.12 2003/08/15 13:58:56 fluxgen Exp $
+// $Id: Button.cc,v 1.13 2003/09/08 15:37:37 fluxgen Exp $
 
 #include "Button.hh"
 
@@ -112,11 +112,16 @@ void Button::buttonReleaseEvent(XButtonEvent &event) {
         XCopyArea(disp, m_foreground_pm, window(), m_gc, 0, 0, width(), height(), 0, 0);
     }
 
+    FbWindow::updateTransparent();
+
+    // finaly, execute command (this must be done last since this object might be deleted by the command)
     if (event.button > 0 && event.button <= 5 &&
+        event.x > 0 && event.x < width() &&
+        event.y > 0 && event.y < height() &&
         m_onclick[event.button -1].get() != 0)
         m_onclick[event.button - 1]->execute();
 
-    FbWindow::updateTransparent();
+
 }
 
 void Button::exposeEvent(XExposeEvent &event) {
-- 
cgit v0.11.2