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);