mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: The taskbar range is calculated incorrectly when zoomed
计算任务栏外部区域时,后端传来的值均为实际值(不受缩放影响的实际屏幕参数),参与计算的均为实际值; 但是当开启缩放后,任务栏在视觉上的高(宽)度比缩放前大,应该乘一个缩放比例,才是任务栏实际的像素高度; 由于后面判断隐藏任务栏时机的时候,是用获取的鼠标坐标实际值与之前存的任务栏的边界作比较,相等时执行隐藏任务栏的动画; 如果之前保存的任务栏参数没有乘缩放比例,那它的高度值只能在40~100之间浮动,但是开启缩放1.25后,它的像素高度应该在50~125之间浮动; 故拿减去实际像素值的范围与鼠标坐标判断才能获取到准确的范围。 Log: 修复开启缩放后任务栏提前隐藏的问题。 Bug: https://pms.uniontech.com/zentao/bug-view-49297.html Change-Id: If8c3b28be213fe67f0085d64bad6d63f19edc4a3 Reviewed-on: http://gerrit.uniontech.com/c/dde-dock/+/6348 Reviewed-by: <mailman@uniontech.com> Reviewed-by: fanpengcheng <fanpengcheng@uniontech.com> Tested-by: <mailman@uniontech.com>
This commit is contained in:
parent
4d1195c834
commit
2a09259cc2
@ -548,9 +548,9 @@ void MultiScreenWorker::onRequestUpdateRegionMonitor()
|
||||
}
|
||||
|
||||
const static int flags = Motion | Button | Key;
|
||||
const static int monitorHeight = 15;
|
||||
const static int monitorHeight = static_cast<int>(15 * qApp->devicePixelRatio());
|
||||
// 后端认为的任务栏大小(无缩放因素影响)
|
||||
const int realDockSize = int(m_displayMode == DisplayMode::Fashion ? m_dockInter->windowSizeFashion() + 2 * 10/*上下的边距各10像素*/ : m_dockInter->windowSizeEfficient());
|
||||
const int realDockSize = int((m_displayMode == DisplayMode::Fashion ? m_dockInter->windowSizeFashion() + 2 * 10 /*上下的边距各10像素*/ : m_dockInter->windowSizeEfficient()) * qApp->devicePixelRatio());
|
||||
|
||||
// 任务栏唤起区域
|
||||
m_monitorRectList.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user