diff --git a/frame/util/menuworker.cpp b/frame/util/menuworker.cpp index 4c797c7ed..337d5542a 100644 --- a/frame/util/menuworker.cpp +++ b/frame/util/menuworker.cpp @@ -196,3 +196,8 @@ void MenuWorker::setAutoHide(const bool autoHide) m_autoHide = autoHide; emit autoHideChanged(m_autoHide); } + +void MenuWorker::onNotifyDaemonInterfaceUpdate(DBusDock *dockInter) +{ + m_dockInter = dockInter; +} diff --git a/frame/util/menuworker.h b/frame/util/menuworker.h index c7501586e..9d09969ca 100644 --- a/frame/util/menuworker.h +++ b/frame/util/menuworker.h @@ -45,6 +45,7 @@ signals: public slots: void setAutoHide(const bool autoHide); + void onNotifyDaemonInterfaceUpdate(DBusDock *dockInter); private: QMenu *createMenu(QMenu *settingsMenu); diff --git a/frame/util/multiscreenworker.cpp b/frame/util/multiscreenworker.cpp index b17fd77d3..3fe8c233c 100644 --- a/frame/util/multiscreenworker.cpp +++ b/frame/util/multiscreenworker.cpp @@ -1371,6 +1371,7 @@ void MultiScreenWorker::checkDaemonDockService() FREE_POINT(m_dockInter); m_dockInter = new DBusDock(serverName, "/com/deepin/dde/daemon/Dock", QDBusConnection::sessionBus(), this); + Q_EMIT notifyDaemonInterfaceUpdate(); // connect connectionInit(m_dockInter); diff --git a/frame/util/multiscreenworker.h b/frame/util/multiscreenworker.h index aa8ac7582..9070999f3 100644 --- a/frame/util/multiscreenworker.h +++ b/frame/util/multiscreenworker.h @@ -169,6 +169,7 @@ signals: void requestStopHideAni(); void requestUpdateDockEntry(); + void notifyDaemonInterfaceUpdate(); public slots: void onAutoHideChanged(bool autoHide); diff --git a/frame/window/mainwindow.cpp b/frame/window/mainwindow.cpp index c08c92ada..8212554bb 100755 --- a/frame/window/mainwindow.cpp +++ b/frame/window/mainwindow.cpp @@ -378,6 +378,10 @@ void MainWindow::initConnections() // 响应后端触控屏拖拽任务栏高度长按信号 connect(TouchSignalManager::instance(), &TouchSignalManager::middleTouchPress, this, &MainWindow::touchRequestResizeDock); connect(TouchSignalManager::instance(), &TouchSignalManager::touchMove, m_dragWidget, &DragWidget::onTouchMove); + + connect(m_multiScreenWorker, &MultiScreenWorker::notifyDaemonInterfaceUpdate, m_menuWorker, [this]() { + m_menuWorker->onNotifyDaemonInterfaceUpdate(m_multiScreenWorker->dockInter()); + }); } /**