From 81a7107969fe71b7c8271a82c503a907b31e22f7 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 30 Dec 2021 23:36:49 +0600 Subject: [PATCH] Fix HiDPI scaling setting --- src/qt/qt_mainwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 67e3237e3..cfe743b0b 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -32,6 +32,7 @@ extern "C" { #include #include #include +#include #include #include @@ -116,8 +117,8 @@ MainWindow::MainWindow(QWidget *parent) : connect(this, &MainWindow::resizeContents, this, [this](int w, int h) { if (!QApplication::platformName().contains("eglfs") && vid_resize == 0) { - w = w / (!dpi_scale ? devicePixelRatio() : 1); - int modifiedHeight = (h / (!dpi_scale ? devicePixelRatio() : 1)) + menuBar()->height() + (statusBar()->height() * !hide_status_bar); + w = w / (!dpi_scale ? this->screen()->devicePixelRatio() : 1); + int modifiedHeight = (h / (!dpi_scale ? this->screen()->devicePixelRatio() : 1)) + menuBar()->height() + (statusBar()->height() * !hide_status_bar); ui->stackedWidget->resize(w, h); if (vid_resize == 0) { setFixedSize(w, modifiedHeight);