From 48f7edc3e934a5f2627126638f454499d79c091a Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 5 Sep 2024 20:54:45 +0200 Subject: [PATCH] Update ApplicationLibCode/Application/RiaGuiApplication.cpp Co-authored-by: codiumai-pr-agent-pro[bot] <151058649+codiumai-pr-agent-pro[bot]@users.noreply.github.com> --- ApplicationLibCode/Application/RiaGuiApplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/Application/RiaGuiApplication.cpp b/ApplicationLibCode/Application/RiaGuiApplication.cpp index f3e58e6a3e..93868dd3d9 100644 --- a/ApplicationLibCode/Application/RiaGuiApplication.cpp +++ b/ApplicationLibCode/Application/RiaGuiApplication.cpp @@ -1528,7 +1528,8 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* //-------------------------------------------------------------------------------------------------- int RiaGuiApplication::applicationResolution() { - if ( RiuMainWindow::instance() ) return RiuMainWindow::instance()->logicalDpiX(); + if (auto screen = QGuiApplication::primaryScreen()) + return screen->logicalDotsPerInchX(); int defaultDPI = 96; return defaultDPI;