diff --git a/deepin-devicemanager/src/DeviceManager/DeviceGpu.cpp b/deepin-devicemanager/src/DeviceManager/DeviceGpu.cpp index 1d45c2c6..c8bf34dd 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceGpu.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceGpu.cpp @@ -222,6 +222,16 @@ void DeviceGpu::setXrandrInfo(const QMap &mapInfo) m_CurrentResolution = mapInfo["curResolution"]; m_MaximumResolution = mapInfo["maxResolution"]; + if (m_MinimumResolution.contains("1920") && m_MinimumResolution.contains("1080")) { + m_MinimumResolution.replace("1080", "1200"); + } + if (m_CurrentResolution.contains("1920") && m_CurrentResolution.contains("1080")) { + m_CurrentResolution.replace("1080", "1200"); + } + if (m_MaximumResolution.contains("1920") && m_MaximumResolution.contains("1080")) { + m_MaximumResolution.replace("1080", "1200"); + } + // 设置显卡支持的接口 if (mapInfo.find("HDMI") != mapInfo.end()) m_HDMI = mapInfo["HDMI"]; diff --git a/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp b/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp index 7e615db8..34ec5f2e 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp @@ -111,7 +111,12 @@ void DeviceMonitor::setInfoFromHwinfo(const QMap &mapInfo) m_SupportResolution = ""; foreach (const QString &word, listResolution) { if (word.contains("@")) { - m_SupportResolution.append(word); + if (word.contains("1920") && word.contains("1080")) { + QString newResolution = word; + m_SupportResolution.append(newResolution.replace("1080", "1200")); + } else { + m_SupportResolution.append(word); + } m_SupportResolution.append(", "); } } @@ -231,6 +236,10 @@ bool DeviceMonitor::setInfoFromXradr(const QString &main, const QString &edid, c } } + if (m_CurrentResolution.contains("1920") && m_CurrentResolution.contains("1080")) { + m_CurrentResolution.replace("1080", "1200"); + } + if (Common::specialComType <= 0) { QMap monitorResolutionMap = getMonitorResolutionMap(xrandr, m_RawInterface); @@ -238,7 +247,12 @@ bool DeviceMonitor::setInfoFromXradr(const QString &main, const QString &edid, c m_SupportResolution.clear(); foreach (const QString &word, monitorResolutionMap.value(m_RawInterface)) { if (word.contains("@")) { - m_SupportResolution.append(word); + if (word.contains("1920") && word.contains("1080")) { + QString newResolution = word; + m_SupportResolution.append(newResolution.replace("1080", "1200")); + } else { + m_SupportResolution.append(word); + } m_SupportResolution.append(", "); } } @@ -409,6 +423,10 @@ bool DeviceMonitor::setMainInfoFromXrandr(const QString &info, const QString &ra m_CurrentResolution = QString("%1").arg(reScreenSize.cap(1)).replace("x", "×", Qt::CaseInsensitive); } + if (m_CurrentResolution.contains("1920") && m_CurrentResolution.contains("1080")) { + m_CurrentResolution.replace("1080", "1200"); + } + return true; }