From eda72d647596b946e754175488f57fa074472c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 14 Oct 2011 20:41:33 +0200 Subject: [PATCH] Don't react on mouse release events in Aurorae if mouse is outside button HAPPY BIRTHDAY KDE. One bug fix as a present. BUG: 283236 FIXED-IN: 4.7.3 --- clients/aurorae/src/lib/auroraebutton.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clients/aurorae/src/lib/auroraebutton.cpp b/clients/aurorae/src/lib/auroraebutton.cpp index 1c66305e8a..1f54a90f20 100644 --- a/clients/aurorae/src/lib/auroraebutton.cpp +++ b/clients/aurorae/src/lib/auroraebutton.cpp @@ -185,8 +185,7 @@ void AuroraeButton::mousePressEvent(QGraphicsSceneMouseEvent* event) void AuroraeButton::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) { - Q_UNUSED(event) - if (m_pressed) { + if (m_pressed && contains(event->pos())) { emit clicked(); } m_pressed = false; @@ -391,7 +390,7 @@ void AuroraeMaximizeButton::mousePressEvent(QGraphicsSceneMouseEvent* event) void AuroraeMaximizeButton::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) { - if (isPressed() && m_pressedButton == event->button()) { + if (isPressed() && m_pressedButton == event->button() && contains(event->pos())) { emit clicked(m_pressedButton); } setPressed(false);