SVN commit 1002921 by peterpan: reject showing tooltips when the popup dialog is showing. BUG:199107 M +9 -0 taskgroupitem.cpp M +15 -1 tasks.cpp M +3 -3 tasks.h M +32 -12 windowtaskitem.cpp --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/taskgroupitem.cpp #1002920:1002921 @@ -192,6 +192,7 @@ //close the popup if the group is removed if (m_popupDialog) { m_popupDialog->hide(); + disconnect(m_popupDialog, 0, 0, 0); m_popupDialog->deleteLater(); m_popupDialog = 0; } @@ -267,6 +268,13 @@ return; } + QWidget * dialog = m_applet->popupDialog(); + + if (dialog && dialog->isVisible()) { + Plasma::ToolTipManager::self()->clearContent(this); + return; + } + Plasma::ToolTipContent data(m_group->name(), i18nc("Which virtual desktop a window is currently on", "On %1", KWindowSystem::desktopName(m_group->desktop()))); @@ -630,6 +638,7 @@ if (!m_popupDialog) { // Initialize popup dialog m_popupDialog = new Plasma::Dialog(); + connect(m_popupDialog, SIGNAL(dialogVisible(bool)), m_applet, SLOT(setPopupDialog(bool))); KWindowSystem::setState(m_popupDialog->winId(), NET::SkipTaskbar| NET::SkipPager); m_popupDialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); //TODO in the future it may be possible to use the Qt::Popup flag instead of the eventFilter, but for now the focus works better with the eventFilter --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/tasks.cpp #1002920:1002921 @@ -52,7 +52,8 @@ m_bottomMargin(0), m_rootGroupItem(0), m_groupManager(0), - m_groupModifierKey(Qt::AltModifier) + m_groupModifierKey(Qt::AltModifier), + m_popupDialog(0) { setHasConfigurationInterface(true); setAspectRatioMode(Plasma::IgnoreAspectRatio); @@ -391,7 +392,20 @@ return m_rootGroupItem; } +QWidget *Tasks::popupDialog() const +{ + return m_popupDialog; +} +void Tasks::setPopupDialog(bool status) +{ + QWidget *widget = qobject_cast(sender()); + + if (widget->isVisible()) { + m_popupDialog = widget; + } +} + K_EXPORT_PLASMA_APPLET(tasks, Tasks) #include "tasks.moc" --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/tasks.h #1002920:1002921 @@ -105,8 +105,7 @@ bool showToolTip() const; void needsVisualFocus(); - - + QWidget *popupDialog() const; signals: /** * emitted whenever we receive a constraintsEvent @@ -116,6 +115,7 @@ protected slots: void configAccepted(); + void setPopupDialog(bool status); protected: void createConfigurationInterface(KConfigDialog *parent); @@ -156,7 +156,7 @@ Qt::KeyboardModifier m_groupModifierKey; int m_currentDesktop; - + QWidget *m_popupDialog; }; #endif --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/windowtaskitem.cpp #1002920:1002921 @@ -185,21 +185,41 @@ { if (!m_task) { return; - } + } + + bool showToolTip = true; + TaskGroupItem *group = parentGroup(); - QPixmap p = m_task->task()->icon(KIconLoader::SizeLarge, KIconLoader::SizeLarge, false); - if (p.height() > KIconLoader::SizeLarge) { - p = p.scaled(QSize(KIconLoader::SizeLarge, KIconLoader::SizeLarge), - Qt::KeepAspectRatio, Qt::SmoothTransformation); - } + if (group) { + QWidget *groupPopupDialog = parentGroup()->popupDialog(); + QWidget *dialog = m_applet->popupDialog(); - Plasma::ToolTipContent data(m_task->name(), - i18nc("Which virtual desktop a window is currently on", "On %1", - KWindowSystem::desktopName(m_task->desktop())), p); - data.setWindowToPreview(m_task->task()->window()); - data.setClickable(true); + if (dialog && dialog->isVisible()) { + if (groupPopupDialog && groupPopupDialog == dialog) { + showToolTip = true; + } else { + showToolTip = false; + } + } + } + + if (showToolTip) { + QPixmap p = m_task->task()->icon(KIconLoader::SizeLarge, KIconLoader::SizeLarge, false); + if (p.height() > KIconLoader::SizeLarge) { + p = p.scaled(QSize(KIconLoader::SizeLarge, KIconLoader::SizeLarge), + Qt::KeepAspectRatio, Qt::SmoothTransformation); + } - Plasma::ToolTipManager::self()->setContent(this, data); + Plasma::ToolTipContent data(m_task->name(), + i18nc("Which virtual desktop a window is currently on", "On %1", + KWindowSystem::desktopName(m_task->desktop())), p); + data.setWindowToPreview(m_task->task()->window()); + data.setClickable(true); + + Plasma::ToolTipManager::self()->setContent(this, data); + } else { + Plasma::ToolTipManager::self()->clearContent(this); + } } void WindowTaskItem::setStartupTask(TaskItem *task)