From e2bd296cf763820327a1df1967b32c277267c161 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Sun, 10 Jan 2010 03:29:07 +0000 Subject: [PATCH] Prevent closing of tab when tab closeButton mouseReleaseEvent occurs outside of the button rect. svn path=/trunk/KDE/kdebase/workspace/; revision=1072363 --- clients/oxygen/oxygenclient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index 5e31b440a6..404c5d4f08 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -1251,7 +1251,8 @@ namespace Oxygen if( widget() == object ) state = mouseReleaseEvent( static_cast< QMouseEvent* >( event ) ); else if( OxygenButton *btn = qobject_cast< OxygenButton* >( object ) ) { - if( static_cast< QMouseEvent* >( event )->button() == Qt::LeftButton ) + QMouseEvent* mouseEvent( static_cast< QMouseEvent* >( event ) ); + if( mouseEvent->button() == Qt::LeftButton && btn->rect().contains( mouseEvent->pos() ) ) { state = closeItem( btn ); } }