From 96b4330e0289e5e5e84489e303527d1b582f35d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E6=9C=8B=E7=A8=8B?= Date: Tue, 7 Jul 2020 17:42:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=86=E8=BE=A8=E7=8E=87=E5=90=8E=E4=BB=BB=E5=8A=A1=E6=A0=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A4=A7=E5=B0=8F=E5=BC=82=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=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-36796.html --- frame/util/docksettings.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frame/util/docksettings.cpp b/frame/util/docksettings.cpp index a8dc34efb..7de277e47 100644 --- a/frame/util/docksettings.cpp +++ b/frame/util/docksettings.cpp @@ -691,11 +691,6 @@ void DockSettings::monitorAdded(const QString &path) connect(inter, &MonitorInter::YChanged, mon, &Monitor::setY); connect(inter, &MonitorInter::WidthChanged, mon, &Monitor::setW); connect(inter, &MonitorInter::HeightChanged, mon, &Monitor::setH); - // 当屏幕的大小或者坐标信息发生变化后,需要更新一下监听区域.防止无法唤醒任务栏 - connect(inter, &MonitorInter::XChanged, this, &DockSettings::requestUpdateRegionWatch); - connect(inter, &MonitorInter::YChanged, this, &DockSettings::requestUpdateRegionWatch); - connect(inter, &MonitorInter::WidthChanged, this, &DockSettings::requestUpdateRegionWatch); - connect(inter, &MonitorInter::HeightChanged, this, &DockSettings::requestUpdateRegionWatch); connect(inter, &MonitorInter::MmWidthChanged, mon, &Monitor::setMmWidth); connect(inter, &MonitorInter::MmHeightChanged, mon, &Monitor::setMmHeight); connect(inter, &MonitorInter::RotationChanged, mon, &Monitor::setRotate); @@ -704,6 +699,14 @@ void DockSettings::monitorAdded(const QString &path) connect(inter, &MonitorInter::ModesChanged, mon, &Monitor::setModeList); connect(inter, &MonitorInter::RotationsChanged, mon, &Monitor::setRotateList); connect(inter, &MonitorInter::EnabledChanged, mon, &Monitor::setMonitorEnable); + + // 当屏幕的大小或者坐标信息发生变化后,需要更新一下监听区域和任务栏大小 + connect(mon, &Monitor::geometryChanged, this, [ = ] { + calculateWindowConfig(); + emit windowGeometryChanged(); + emit requestUpdateRegionWatch(); + }); + connect(m_displayInter, static_cast(&DisplayInter::PrimaryChanged), mon, &Monitor::setPrimary); // NOTE: DO NOT using async dbus call. because we need to have a unique name to distinguish each monitor