From 6421fed1ab918cc0821dd8bcf83dfa3376b2c686 Mon Sep 17 00:00:00 2001 From: chenbin Date: Tue, 17 May 2022 20:37:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=90=8E=E8=AE=BE=E7=BD=AE=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=8C=E4=BB=BB=E5=8A=A1=E6=A0=8F=E6=97=A0?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 延迟50ms隐藏,避免设置任务栏状态未及时更新 Log: 修复一直隐藏后设置一直显示,任务栏无图标的问题 Influence: 任务栏 Task: https://pms.uniontech.com/task-view-130595.html Change-Id: I995f9516dfc8a04e1ab639c44d8aab047556e095 --- frame/util/multiscreenworker.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frame/util/multiscreenworker.cpp b/frame/util/multiscreenworker.cpp index 4353ffa67..ebdc5991b 100644 --- a/frame/util/multiscreenworker.cpp +++ b/frame/util/multiscreenworker.cpp @@ -1408,11 +1408,13 @@ void MultiScreenWorker::checkXEventMonitorService() // 在鼠标拖动任务栏在最大尺寸的时候,如果当前任务栏为隐藏模式(一直隐藏或智能隐藏),在松开鼠标的那一刻,判断当前 // 鼠标位置是否在任务栏外面(isCursorOut(x,y)==true),此时需要触发onExtralRegionMonitorChanged函数, // 目的是为了让其触发隐藏 - if (isCursorOut(x, y) - && (m_hideMode == HideMode::KeepHidden || m_hideMode == HideMode::SmartHide)) { - qApp->setProperty("DRAG_STATE", false); - onExtralRegionMonitorChanged(0, 0, m_extralRegisterKey); - } + QTimer::singleShot(50, this, [ = ] { + if (isCursorOut(x, y) + && (m_hideMode == HideMode::KeepHidden || m_hideMode == HideMode::SmartHide)) { + qApp->setProperty("DRAG_STATE", false); + onExtralRegionMonitorChanged(0, 0, m_extralRegisterKey); + } + }); }); connect(extralEventInter, &XEventMonitor::CursorOut, this, [ = ](int x, int y, const QString &key) {