SVN commit 1199169 by aseigo: merge hideIfNotInUse with startAutoHide, since it should never autohide if in use. M +19 -14 panelview.cpp M +1 -4 panelview.h --- trunk/KDE/kdebase/workspace/plasma/desktop/shell/panelview.cpp #1199168:1199169 @@ -615,7 +615,7 @@ m_mousePollTimer->stop(); } - QTimer::singleShot(2000, this, SLOT(hideIfNotInUse())); + QTimer::singleShot(2000, this, SLOT(startAutoHide())); } KWindowSystem::setOnAllDesktops(winId(), true); @@ -1097,7 +1097,7 @@ updateStruts(); if (m_visibilityMode == LetWindowsCover || m_visibilityMode == AutoHide) { - hideIfNotInUse(); + startAutoHide(); } } @@ -1330,16 +1330,6 @@ } } -void PanelView::hideIfNotInUse() -{ - //kDebug() << m_delayedUnhideTs.elapsed() << geometry().contains(QCursor::pos()) << hasPopup(); - //TODO: is 5s too long? not long enough? - if ((m_delayedUnhideTs.isNull() || m_delayedUnhideTs.elapsed() > 5000) && !m_editing && - !geometry().adjusted(-10, -10, 10, 10).contains(QCursor::pos()) && !hasPopup()) { - startAutoHide(); - } -} - void PanelView::updateHinter() { #ifdef Q_WS_X11 @@ -1514,9 +1504,21 @@ void PanelView::startAutoHide() { + //kDebug() << m_delayedUnhideTs.elapsed() << geometry().contains(QCursor::pos()) << hasPopup(); + //TODO: is 5s too long? not long enough? + if ((!m_delayedUnhideTs.isNull() && m_delayedUnhideTs.elapsed() < 5000) || + m_editing || + geometry().adjusted(-10, -10, 10, 10).contains(QCursor::pos()) || + hasPopup()) { + if (!m_mousePollTimer) { + leaveEvent(0); + } + return; + } + if (m_mousePollTimer) { m_mousePollTimer->stop(); - disconnect(m_mousePollTimer, SIGNAL(timeout()), this, SLOT(hideIfNotInUse())); + disconnect(m_mousePollTimer, SIGNAL(timeout()), this, SLOT(startAutoHide())); } if (m_visibilityMode == LetWindowsCover) { @@ -1548,12 +1550,15 @@ m_mousePollTimer = new QTimer(this); } - connect(m_mousePollTimer, SIGNAL(timeout()), this, SLOT(hideIfNotInUse()), Qt::UniqueConnection); + connect(m_mousePollTimer, SIGNAL(timeout()), this, SLOT(startAutoHide()), Qt::UniqueConnection); m_mousePollTimer->start(200); } + if (event) { + // startAutoHide calls this with a null event pointer, so we have to check it Plasma::View::leaveEvent(event); } +} void PanelView::drawBackground(QPainter *painter, const QRectF &rect) { --- trunk/KDE/kdebase/workspace/plasma/desktop/shell/panelview.h #1199168:1199169 @@ -247,11 +247,8 @@ void overlayMoved(PanelAppletOverlay *overlay); void panelDeleted(); void startAutoHide(); + /** - * hides the panel if there's nothing keeping it open - */ - void hideIfNotInUse(); - /** * update the appearance of the unhide hinter * and get rid of it if the mouse has gone elsewhere */