From 6e135bb792e8d237e0bab08bbf1d74481c464e67 Mon Sep 17 00:00:00 2001 From: shuaijie Date: Mon, 14 Oct 2024 19:32:05 +0800 Subject: [PATCH] fix: the screen size unbelive follow the edid spec, the screen size width 15 and height 16 Log: follow the edit spec Bug: https://pms.uniontech.com/bug-view-277559.html --- deepin-devicemanager/src/Tool/EDIDParser.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/deepin-devicemanager/src/Tool/EDIDParser.cpp b/deepin-devicemanager/src/Tool/EDIDParser.cpp index 2bcd1003..26dd3ea5 100644 --- a/deepin-devicemanager/src/Tool/EDIDParser.cpp +++ b/deepin-devicemanager/src/Tool/EDIDParser.cpp @@ -173,16 +173,22 @@ void EDIDParser::parseReleaseDate() void EDIDParser::parseScreenSize() { - // edid中的 15H和16H就是屏幕大小 + + //Detailed Timing if(m_LittleEndianMode){ QString tmpw = getBytes(4,2); QString tmph = getBytes(4,3); QString tmpshl = getBytes(4,4); m_Width = hexToDec(tmpshl.mid(0,1) + tmpw).toInt(); m_Height = hexToDec(tmpshl.mid(1,1) + tmph).toInt(); - }else { - m_Width = hexToDec(getBytes(1, m_LittleEndianMode ? 5 : 4)).toInt()*10; - m_Height = hexToDec(getBytes(1, m_LittleEndianMode ? 6 : 7)).toInt()*10; + } + + // edid中的 15H和16H就是屏幕大小 , 与Detailed Timing相差超10mm 则用15H和16H的。 + int width15 = hexToDec(getBytes(1, m_LittleEndianMode ? 5 : 4)).toInt()*10; + int height16 = hexToDec(getBytes(1, m_LittleEndianMode ? 6 : 7)).toInt()*10; + if(m_Width+10 < width15 || m_Height+10 < height16) { + m_Width = width15; + m_Height = height16; } double inch = sqrt((m_Width / 2.54) * (m_Width / 2.54) + (m_Height / 2.54) * (m_Height / 2.54))/10;