fix: 设置位置异常

setGeometry需要根据当前屏幕左上角的坐标将传入的rect转换为真实的坐标,
在屏幕个数变化后,有一段时间qt中保存的屏幕坐标还未刷新正确,导致这里设置失败。
故在设置前先与qt中保存的窗口参数比较一下,而不是与上一次设置的参数比较。

Log: 修复任务栏位置错误的问题。
Bug: https://pms.uniontech.com/zentao/bug-view-57039.html
Change-Id: I77fe40583a9ce1b96727bc55d0c264c6c13598c4
This commit is contained in:
Zhang Qipeng 2021-02-20 14:22:00 +08:00
parent 88edefc1f2
commit 35b1f97130

View File

@ -567,11 +567,9 @@ void MainWindow::touchRequestResizeDock()
void MainWindow::setGeometry(const QRect &rect)
{
static QRect lastRect;
if (lastRect == rect) {
if (rect == this->geometry()) {
return;
}
lastRect = rect;
DBlurEffectWidget::setGeometry(rect);
emit panelGeometryChanged();
}