diff --git a/frame/window/quickpluginwindow.cpp b/frame/window/quickpluginwindow.cpp index 812e0cf13..16e85f5b9 100644 --- a/frame/window/quickpluginwindow.cpp +++ b/frame/window/quickpluginwindow.cpp @@ -202,6 +202,20 @@ bool QuickPluginWindow::eventFilter(QObject *watched, QEvent *event) if (!m_dragInfo->canDrag(mouseEvent->pos())) { // 弹出快捷设置面板 DockPopupWindow *popWindow = QuickSettingContainer::popWindow(); + if (Utils::IS_WAYLAND_DISPLAY) { + // TODO: 临时解决方案,如果是wayland环境,toolTip没有消失,因此,此处直接调用接口来隐藏 + for (int i = m_mainLayout->count() - 1; i >= 0; i--) { + QLayoutItem *layoutItem = m_mainLayout->itemAt(i); + if (!layoutItem) + continue; + + QuickDockItem *dockItem = qobject_cast(layoutItem->widget()); + if (!dockItem) + continue; + + dockItem->hideToolTip(); + } + } popWindow->show(popupPoint()); } m_dragInfo->reset(); @@ -533,6 +547,11 @@ bool QuickDockItem::isPrimary() const return false; } +void QuickDockItem::hideToolTip() +{ + m_popupWindow->hide(); +} + void QuickDockItem::paintEvent(QPaintEvent *event) { if (!m_pluginItem) diff --git a/frame/window/quickpluginwindow.h b/frame/window/quickpluginwindow.h index 9d07fac8b..b36eb08a8 100644 --- a/frame/window/quickpluginwindow.h +++ b/frame/window/quickpluginwindow.h @@ -98,6 +98,7 @@ public: void setPositon(Dock::Position position); PluginsItemInterface *pluginItem(); bool isPrimary() const; + void hideToolTip(); protected: void paintEvent(QPaintEvent *event) override;