From e02ce4f03ba1e01e5ab8e4407092d3d0f3e46d4f Mon Sep 17 00:00:00 2001 From: donghualin Date: Wed, 26 Oct 2022 09:11:56 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=AB=98=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E7=8E=87=E4=B8=8B=E5=90=AF=E5=8A=A8=E5=99=A8=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E5=92=8C=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=AE=BE=E7=BD=AE=E6=99=BA=E8=83=BD=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 向后端发送任务栏尺寸的时候,无需计算分辨率相关,此处去掉分辨率的设置 Log: 优化高缩放率下任务栏的数据错误 Influence: 前提:屏幕分辨率设置为1.25;1、任务栏设置为智能隐藏,将窗口拖动到任务栏下方,观察任务栏是否隐藏;2、观察启动器的位置是否正确 Bug: https://pms.uniontech.com/bug-view-154513.html Bug: https://pms.uniontech.com/bug-view-157413.html Change-Id: Iebd9f31b9207852425d5215bb3b92152ec4ab46c --- frame/window/mainwindowbase.cpp | 2 +- frame/window/windowmanager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frame/window/mainwindowbase.cpp b/frame/window/mainwindowbase.cpp index 4a93619ff..ea8d83b86 100644 --- a/frame/window/mainwindowbase.cpp +++ b/frame/window/mainwindowbase.cpp @@ -388,7 +388,7 @@ QRect MainWindowBase::getDockGeometry(QScreen *screen, const Dock::Position &pos const int margin = static_cast((displaymode == DisplayMode::Fashion ? 10 : 0) * (withoutScale ? qApp->devicePixelRatio() : 1)); int dockSize = 0; if (hideState == Dock::HideState::Show) - dockSize = windowSize(); + dockSize = windowSize() * (withoutScale ? qApp->devicePixelRatio() : 1); // 拿到当前显示器缩放之前的分辨率 QRect screenRect = screen->handle()->geometry(); diff --git a/frame/window/windowmanager.cpp b/frame/window/windowmanager.cpp index da00261ee..58649f53b 100644 --- a/frame/window/windowmanager.cpp +++ b/frame/window/windowmanager.cpp @@ -601,7 +601,7 @@ void WindowManager::onChangeDockPosition(QString fromScreen, QString toScreen, c void WindowManager::onRequestUpdateFrontendGeometry() { - QRect rect = getDockGeometry(false); + QRect rect = getDockGeometry(true); // 向com.deepin.dde.daemon.Dock的SetFrontendWindowRect接口设置区域时,此区域的高度或宽度不能为0,否则会导致其HideState属性循环切换,造成任务栏循环显示或隐藏 if (rect.width() == 0 || rect.height() == 0) return;