Skip to content

Commit

Permalink
fix: dock plugin unable to click when in keep hide
Browse files Browse the repository at this point in the history
make dock not hide when click plugin and popup show even in keep hide mode

log: as title
issue: linuxdeepin/developer-center#7132
  • Loading branch information
tsic404 committed Jan 30, 2024
1 parent 478f564 commit 710a9f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions frame/taskmanager/taskmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <cstdint>
#include <dtkcore_global.h>
#include <functional>
#include <iterator>
#include <memory>
#include <algorithm>
Expand Down Expand Up @@ -976,7 +977,7 @@ QVector<XWindow> TaskManager::getActiveWinGroup(XWindow xid)
*/
void TaskManager::updateHideState(bool delay)
{
if (m_ddeLauncherVisible || m_trayGridWidgetVisible || m_popupVisible) {
if (preventDockAutoHide()) {
setPropHideState(HideState::Show);
return;
}
Expand Down Expand Up @@ -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));
}

/**
Expand Down Expand Up @@ -1605,3 +1606,8 @@ bool TaskManager::showMultiWindow() const
{
return m_showMultiWindow;
}

bool TaskManager::preventDockAutoHide() const
{
return m_ddeLauncherVisible || m_popupVisible || m_trayGridWidgetVisible;
}
1 change: 1 addition & 0 deletions frame/taskmanager/taskmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class TaskManager : public QObject

void previewWindow(uint xid);
void cancelPreviewWindow();
bool preventDockAutoHide() const;

Q_SIGNALS:
void serviceRestarted();
Expand Down
2 changes: 1 addition & 1 deletion frame/util/multiscreenworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 710a9f5

Please sign in to comment.