From dbc48526247e47a06eac0e69446dc435c21f78c2 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 2 Apr 2009 16:43:41 +0000 Subject: [PATCH] if a qmenu is open the handle doesn't disappear, make it disappear as soon as the menu closes, this way it doesn't steal anymore the focus to the applet BUG:180752 svn path=/trunk/KDE/kdelibs/; revision=948256 --- private/applethandle.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/private/applethandle.cpp b/private/applethandle.cpp index a63552997..afd61af6a 100644 --- a/private/applethandle.cpp +++ b/private/applethandle.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -791,6 +792,15 @@ void AppletHandle::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); + foreach (QWidget *widget, QApplication::topLevelWidgets()) { + QMenu *menu = qobject_cast(widget); + if (menu && menu->isVisible()) { + connect(menu, SIGNAL(aboutToHide()), this, SLOT(leaveTimeout())); + return; + } + } + + // if we haven't even showed up yet, remove the handle if (m_hoverTimer->isActive()) { m_hoverTimer->stop();