From 2055820d300a5a367bf5238cf1aa6537aa8661cd Mon Sep 17 00:00:00 2001 From: donghualin Date: Tue, 14 Jun 2022 13:23:05 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ddock=E5=9C=A8=E6=97=B6?= =?UTF-8?q?=E5=B0=9A=E6=A8=A1=E5=BC=8F=E4=B8=8B=E9=98=B2=E5=91=86=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 时尚模式下由于任务栏没有铺满整个屏幕区域,因此在处理任务栏struct的时候,让其选择整个区域 Log: Influence: 任务栏-拖动窗口到最下方的区域 Bug: https://pms.uniontech.com/bug-view-134075.html Change-Id: I4eb3357c01637b6e1cdfc25a0b4f0c5e316ad290 --- frame/util/multiscreenworker.cpp | 35 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/frame/util/multiscreenworker.cpp b/frame/util/multiscreenworker.cpp index 9945832d9..526bf25d7 100644 --- a/frame/util/multiscreenworker.cpp +++ b/frame/util/multiscreenworker.cpp @@ -762,6 +762,8 @@ void MultiScreenWorker::onRequestNotifyWindowManager() qDebug() << "dock real geometry:" << dockGeometry; qDebug() << "screen width:" << DIS_INS->screenRawWidth() << ", height:" << DIS_INS->screenRawHeight(); + QScreen *curentScreen = DIS_INS->screen(m_ds.current()); + Q_ASSERT(curentScreen); const qreal &ratio = qApp->devicePixelRatio(); if (Utils::IS_WAYLAND_DISPLAY) { QList varList = {0, 0, 0, 0}; @@ -769,26 +771,26 @@ void MultiScreenWorker::onRequestNotifyWindowManager() case Position::Top: varList[0] = 1; varList[1] = dockGeometry.y() + dockGeometry.height() + WINDOWMARGIN * ratio; - varList[2] = dockGeometry.x(); - varList[3] = dockGeometry.x() + dockGeometry.width(); + varList[2] = 0; + varList[3] = curentScreen->availableSize().width(); break; case Position::Bottom: varList[0] = 3; varList[1] = DIS_INS->screenRawHeight() - dockGeometry.y() + WINDOWMARGIN * ratio; - varList[2] = dockGeometry.x(); - varList[3] = dockGeometry.x() + dockGeometry.width(); + varList[2] = 0; + varList[3] = curentScreen->availableSize().width(); break; case Position::Left: varList[0] = 0; varList[1] = dockGeometry.x() + dockGeometry.width() + WINDOWMARGIN * ratio; - varList[2] = dockGeometry.y(); - varList[3] = dockGeometry.y() + dockGeometry.height(); + varList[2] = 0; + varList[3] = curentScreen->availableSize().height(); break; case Position::Right: varList[0] = 2; varList[1] = DIS_INS->screenRawWidth() - dockGeometry.x() + WINDOWMARGIN * ratio; - varList[2] = dockGeometry.y(); - varList[3] = dockGeometry.y() + dockGeometry.height(); + varList[2] = 0; + varList[3] = curentScreen->availableSize().height(); break; } @@ -805,26 +807,26 @@ void MultiScreenWorker::onRequestNotifyWindowManager() case Position::Top: orientation = XcbMisc::OrientationTop; strut = dockGeometry.y() + dockGeometry.height(); - strutStart = dockGeometry.x(); - strutEnd = qMin(dockGeometry.x() + dockGeometry.width(), dockGeometry.right()); + strutStart = 0; + strutEnd = curentScreen->availableSize().width(); break; case Position::Bottom: orientation = XcbMisc::OrientationBottom; strut = DIS_INS->screenRawHeight() - dockGeometry.y(); - strutStart = dockGeometry.x(); - strutEnd = qMin(dockGeometry.x() + dockGeometry.width(), dockGeometry.right()); + strutStart = 0; + strutEnd = curentScreen->availableSize().width(); break; case Position::Left: orientation = XcbMisc::OrientationLeft; strut = dockGeometry.x() + dockGeometry.width(); - strutStart = dockGeometry.y(); - strutEnd = qMin(dockGeometry.y() + dockGeometry.height(), dockGeometry.bottom()); + strutStart = 0; + strutEnd = curentScreen->availableSize().height(); break; case Position::Right: orientation = XcbMisc::OrientationRight; strut = DIS_INS->screenRawWidth() - dockGeometry.x(); - strutStart = dockGeometry.y(); - strutEnd = qMin(dockGeometry.y() + dockGeometry.height(), dockGeometry.bottom()); + strutStart = 0; + strutEnd = curentScreen->availableSize().height(); break; } @@ -902,6 +904,7 @@ void MultiScreenWorker::onChildSizeChanged() QSize dockSize = dockRect(m_ds.current(), position(), HideMode::KeepShowing, displayMode()).size(); parent()->setFixedSize(dockSize); + parent()->setGeometry(dockRect(m_ds.current())); parent()->panel()->setFixedSize(dockSize); parent()->panel()->move(0, 0); parent()->panel()->update();