Browse Source

UI: Don't round non-integer High DPI scale

This fixes an issue on Windows where loading on a
150% scale display renders OBS windows at 200%.

Reference: https://doc.qt.io/qt-5/qguiapplication.html#setHighDpiScaleFactorRoundingPolicy
Matt Gajownik 5 years ago
parent
commit
e08a8fc356
1 changed files with 4 additions and 0 deletions
  1. 4 0
      UI/obs-app.cpp

+ 4 - 0
UI/obs-app.cpp

@@ -1932,6 +1932,10 @@ static int run_program(fstream &logFile, int argc, char *argv[])
 #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
 	QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
 #endif
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
+	QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
+		Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
+#endif
 
 #if !defined(_WIN32) && !defined(__APPLE__) && BROWSER_AVAILABLE
 	setenv("QT_NO_GLIB", "1", true);