fix: 修复切换分辨率后任务栏显示大小异常的问题

在分辨率发生变化,应该优先更新屏幕的大小信息再根据这些信息及计算出任务栏的位置,代码里逻辑是反的

Log: 修复切换分辨率后任务栏显示大小异常的问题
Bug: https://pms.uniontech.com/zentao/bug-view-36796.html
This commit is contained in:
范朋程 2020-07-07 17:42:05 +08:00
parent 3fa69b4201
commit 96b4330e02

View File

@ -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<void (DisplayInter::*)(const QString &) const>(&DisplayInter::PrimaryChanged), mon, &Monitor::setPrimary);
// NOTE: DO NOT using async dbus call. because we need to have a unique name to distinguish each monitor