From 74475ecf867e4710f733369bf6d003153ce09d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E6=9C=8B=E7=A8=8B?= Date: Mon, 22 Jun 2020 14:03:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=A0=8F=E5=90=84=E7=A7=8D=E6=97=A0=E6=B3=95=E5=94=A4=E9=86=92?= =?UTF-8?q?=E5=92=8C=E6=98=BE=E7=A4=BA=E9=94=99=E4=BD=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 任务栏无法唤醒基本都是因为监听的屏幕区域没有在屏幕大小和坐标发生变化的时候及时更新信息, 显示错位是因为动画完成后内部有些变量未更新导致的, Log: 修复任务栏隐藏后切换位置或者调整屏幕无法唤起和显示到屏幕外部的问题 Bug: https://pms.uniontech.com/zentao/bug-view-34468.html Bug: https://pms.uniontech.com/zentao/bug-view-34467.html Bug: https://pms.uniontech.com/zentao/bug-view-34458.html Bug: https://pms.uniontech.com/zentao/bug-view-34454.html Bug: https://pms.uniontech.com/zentao/bug-view-34444.html Bug: https://pms.uniontech.com/zentao/bug-view-34437.html Bug: https://pms.uniontech.com/zentao/bug-view-34340.html Bug: https://pms.uniontech.com/zentao/bug-view-33718.html Bug: https://pms.uniontech.com/zentao/bug-view-33693.html Bug: https://pms.uniontech.com/zentao/bug-view-32854.html Bug: https://pms.uniontech.com/zentao/bug-view-32849.html Bug: https://pms.uniontech.com/zentao/bug-view-32830.html --- frame/util/docksettings.cpp | 2 ++ frame/util/docksettings.h | 1 + frame/window/mainwindow.cpp | 7 ++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frame/util/docksettings.cpp b/frame/util/docksettings.cpp index 04d08dd96..3a14992d7 100644 --- a/frame/util/docksettings.cpp +++ b/frame/util/docksettings.cpp @@ -499,6 +499,8 @@ void DockSettings::resetFrontendGeometry() m_frontendRect = QRect(p.x(), p.y(), w, h); m_dockInter->SetFrontendWindowRect(p.x(), p.y(), w, h); + + emit requestUpdateDockGeometry(m_frontendRect); } void DockSettings::updateFrontendGeometry() diff --git a/frame/util/docksettings.h b/frame/util/docksettings.h index e030e61a5..f247a0a0d 100644 --- a/frame/util/docksettings.h +++ b/frame/util/docksettings.h @@ -95,6 +95,7 @@ signals: void trayCountChanged() const; // 分标率发生变化,需要更新XEventMonitor的监视区域 void requestUpdateRegionWatch(); + void requestUpdateDockGeometry(const QRect &rect); public slots: void updateGeometry(); diff --git a/frame/window/mainwindow.cpp b/frame/window/mainwindow.cpp index 1b68d3015..59eccded0 100644 --- a/frame/window/mainwindow.cpp +++ b/frame/window/mainwindow.cpp @@ -306,7 +306,7 @@ bool MainWindow::event(QEvent *e) switch (e->type()) { case QEvent::Move: if (!e->spontaneous()) - QTimer::singleShot(1, this, &MainWindow::positionCheck); + QTimer::singleShot(100, this, &MainWindow::positionCheck); break; default:; } @@ -824,7 +824,6 @@ void MainWindow::adjustShadowMask() DStyleHelper dstyle(style()); const int radius = dstyle.pixelMetric(DStyle::PM_TopLevelWindowRadius); - m_platformWindowHandle.setWindowRadius(composite && isFasion ? radius : 0); } @@ -839,7 +838,9 @@ void MainWindow::positionCheck() return; // this may cause some position error and animation caton - //internalMove(); + bool isHide = m_settings->hideState() == Hide && !testAttribute(Qt::WA_UnderMouse); + const QRect windowRect = m_settings->windowRect(m_dockPosition, isHide); + internalMove(windowRect.topLeft()); } void MainWindow::onDbusNameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)