diff --git a/frame/dbus/dbusdockentry.h b/frame/dbus/dbusdockentry.h index a68481d9e..56b244db2 100644 --- a/frame/dbus/dbusdockentry.h +++ b/frame/dbus/dbusdockentry.h @@ -79,6 +79,10 @@ public: inline QString menu() const { return qvariant_cast< QString >(property("Menu")); } + Q_PROPERTY(QString Name READ name NOTIFY NameChanged) + inline QString name() const + { return qvariant_cast< QString >(property("Name")); } + Q_PROPERTY(quint32 CurrentWindow READ currentWindow NOTIFY CurrentWindowChanged) inline quint32 currentWindow() const { return qvariant_cast< quint32 >(property("CurrentWindow")); } @@ -122,6 +126,7 @@ void IdChanged(); void TitleChanged(); void IconChanged(); void MenuChanged(); +void NameChanged(); void CurrentWindowChanged(); }; diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index bac4c806d..f3a8837f1 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -288,14 +288,17 @@ const QString AppItem::contextMenu() const QWidget *AppItem::popupTips() { - if (m_titles.isEmpty()) - return nullptr; if (m_draging) return nullptr; - const quint32 currentWindow = m_itemEntry->currentWindow(); - Q_ASSERT(m_titles.contains(currentWindow)); - m_appNameTips->setText(m_titles[currentWindow]); + if (!m_titles.isEmpty()) + { + const quint32 currentWindow = m_itemEntry->currentWindow(); + Q_ASSERT(m_titles.contains(currentWindow)); + m_appNameTips->setText(m_titles[currentWindow]); + } else { + m_appNameTips->setText(m_itemEntry->name()); + } return m_appNameTips; }