From 710a9f562bcbefdc508fdb25bd87c3c8b5785d06 Mon Sep 17 00:00:00 2001 From: tsic404 Date: Tue, 30 Jan 2024 15:32:34 +0800 Subject: [PATCH] fix: dock plugin unable to click when in keep hide make dock not hide when click plugin and popup show even in keep hide mode log: as title issue: https://github.com/linuxdeepin/developer-center/issues/7132 --- frame/taskmanager/taskmanager.cpp | 10 ++++++++-- frame/taskmanager/taskmanager.h | 1 + frame/util/multiscreenworker.cpp | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frame/taskmanager/taskmanager.cpp b/frame/taskmanager/taskmanager.cpp index 07f842aa3..d93690839 100644 --- a/frame/taskmanager/taskmanager.cpp +++ b/frame/taskmanager/taskmanager.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -976,7 +977,7 @@ QVector TaskManager::getActiveWinGroup(XWindow xid) */ void TaskManager::updateHideState(bool delay) { - if (m_ddeLauncherVisible || m_trayGridWidgetVisible || m_popupVisible) { + if (preventDockAutoHide()) { setPropHideState(HideState::Show); return; } @@ -1165,7 +1166,7 @@ void TaskManager::handleActiveWindowChanged(WindowInfoBase *info) m_activeWindow = info; XWindow winId = m_activeWindow->getXid(); m_entries->handleActiveWindowChanged(winId); - updateHideState(true); + QTimer::singleShot(200, std::bind(&TaskManager::updateHideState, this, true)); } /** @@ -1605,3 +1606,8 @@ bool TaskManager::showMultiWindow() const { return m_showMultiWindow; } + +bool TaskManager::preventDockAutoHide() const +{ + return m_ddeLauncherVisible || m_popupVisible || m_trayGridWidgetVisible; +} diff --git a/frame/taskmanager/taskmanager.h b/frame/taskmanager/taskmanager.h index c89210221..f4480a0a1 100644 --- a/frame/taskmanager/taskmanager.h +++ b/frame/taskmanager/taskmanager.h @@ -129,6 +129,7 @@ class TaskManager : public QObject void previewWindow(uint xid); void cancelPreviewWindow(); + bool preventDockAutoHide() const; Q_SIGNALS: void serviceRestarted(); diff --git a/frame/util/multiscreenworker.cpp b/frame/util/multiscreenworker.cpp index 69cc3c8bb..96852c13b 100644 --- a/frame/util/multiscreenworker.cpp +++ b/frame/util/multiscreenworker.cpp @@ -128,7 +128,7 @@ void MultiScreenWorker::onExtralRegionMonitorChanged(int x, int y, const QString // 鼠标移动到任务栏界面之外,停止计时器(延时2秒改变任务栏所在屏幕) m_delayWakeTimer->stop(); - if (m_hideMode == HideMode::KeepHidden) { + if (m_hideMode == HideMode::KeepHidden && !TaskManager::instance()->preventDockAutoHide()) { TaskManager::instance()->setPropHideState(HideState::Hide); }