mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: 修改获取屏幕区域当前分辨率的显示方式
显示器同时连接4k屏幕和1080屏幕,若在4k屏幕下设置缩放因子为2.75,得到的原始分辨率始终比实际原始分辨率大,导致桌面无法正确识别当前的显示器 Log: 修复屏幕缩放因子为小数的情况下屏幕分辨率的误差的问题 Bug: https://pms.uniontech.com/zentao/bug-view-87627.html Change-Id: Ice1369af0d756837aa527131503d8a380b5d8cf0
This commit is contained in:
parent
3b0abb9129
commit
aeced57129
@ -1378,7 +1378,9 @@ QRect MultiScreenWorker::getDockShowGeometry(const QString &screenName, const Po
|
||||
for (auto s : DIS_INS->screens()) {
|
||||
if (s->name() == screenName) {
|
||||
QRect screenRect = s->geometry();
|
||||
screenRect.setSize(screenRect.size() * s->devicePixelRatio());
|
||||
// 不能直接用screenRect乘缩放率,因为那样会四舍五入得到的数值有误差,桌面在判断当前显示器的时候得到的显示器错误,引起桌面图标的显示错误
|
||||
screenRect.setWidth(s->geometry().x() + int(s->geometry().width() * s->devicePixelRatio()));
|
||||
screenRect.setHeight(s->geometry().y() + int(s->geometry().height() * s->devicePixelRatio()));
|
||||
|
||||
switch (pos) {
|
||||
case Position::Top:
|
||||
@ -1429,7 +1431,9 @@ QRect MultiScreenWorker::getDockHideGeometry(const QString &screenName, const Po
|
||||
for (auto s : DIS_INS->screens()) {
|
||||
if (s->name() == screenName) {
|
||||
QRect screenRect = s->geometry();
|
||||
screenRect.setSize(screenRect.size() * s->devicePixelRatio());
|
||||
// 不能直接用screenRect乘缩放率,因为那样会四舍五入得到的数值有误差,桌面在判断当前显示器的时候得到的显示器错误,引起桌面图标的显示错误
|
||||
screenRect.setWidth(s->geometry().x() + int(s->geometry().width() * s->devicePixelRatio()));
|
||||
screenRect.setHeight(s->geometry().y() + int(s->geometry().height() * s->devicePixelRatio()));
|
||||
|
||||
switch (pos) {
|
||||
case Position::Top:
|
||||
|
Loading…
x
Reference in New Issue
Block a user