We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9bc47d3 + 886ca9e commit 2f0cc6fCopy full SHA for 2f0cc6f
src/framework/ui/internal/uiconfiguration.cpp
@@ -648,9 +648,16 @@ double UiConfiguration::physicalDpi() const
648
return m_customDPI.value();
649
}
650
651
+ constexpr double DEFAULT_DPI = 96;
652
const QScreen* screen = mainWindow() ? mainWindow()->screen() : nullptr;
653
if (!screen) {
- constexpr double DEFAULT_DPI = 96;
654
+ return DEFAULT_DPI;
655
+ }
656
+
657
+ auto physicalSize = screen->physicalSize();
658
+ // Work around xrandr reporting a 1x1mm size if
659
+ // the screen doesn't have a valid physical size
660
+ if (physicalSize.height() <= 1 && physicalSize.width() <= 1) {
661
return DEFAULT_DPI;
662
663
0 commit comments