From: Peter Penz Date: Fri, 23 Jul 2010 12:26:57 +0000 (+0000) Subject: Fix visual artefacts for tooltips, if compositing has been disabled. Thanks to Maciej... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/4ba9eb8ea34baee7e5e100a0d3c33f23f75cf708?ds=sidebyside Fix visual artefacts for tooltips, if compositing has been disabled. Thanks to Maciej Mrozowski for analyzing the root cause! Also a minor issue is fixed with the upper/left position: It may never overlap with the icon area. BUG: 245491 svn path=/trunk/KDE/kdebase/apps/; revision=1153521 --- diff --git a/src/tooltips/tooltipmanager.cpp b/src/tooltips/tooltipmanager.cpp index b5a3097f0..f44adf2ad 100644 --- a/src/tooltips/tooltipmanager.cpp +++ b/src/tooltips/tooltipmanager.cpp @@ -25,6 +25,7 @@ #include "filemetadatatooltip.h" #include #include +#include #include #include @@ -228,14 +229,14 @@ void ToolTipManager::showToolTip() x = desktop.right() - size.width(); } if (hasRoomBelow) { - y = m_itemRect.bottom(); + y = m_itemRect.bottom() + 1; } else { y = m_itemRect.top() - size.height(); } } else { Q_ASSERT(hasRoomToLeft || hasRoomToRight); if (hasRoomToRight) { - x = m_itemRect.right(); + x = m_itemRect.right() + 1; } else { x = m_itemRect.left() - size.width(); } @@ -263,10 +264,12 @@ void ToolTipManager::showToolTipDelayed(const QPixmap& pixmap) // content (QWidgets don't update their layout geometry if they are invisible). To // assure having a consistent size without relayout flickering, the tooltip is opened // on an invisible position first. This gives the layout system some time to asynchronously - // update the content. - const QRect desktop = QApplication::desktop()->screenGeometry(m_itemRect.bottomRight()); - m_fileMetaDataToolTip->move(desktop.bottomRight()); - m_fileMetaDataToolTip->show(); + // update the content. Sadly this only works with compositing enabled. + if (KWindowSystem::compositingActive()) { + const QRect desktop = QApplication::desktop()->screenGeometry(m_itemRect.bottomRight()); + m_fileMetaDataToolTip->move(desktop.bottomRight()); + m_fileMetaDataToolTip->show(); + } m_showToolTipDelayedTimer->start(); // Calls ToolTipManager::showToolTip() }