From a495888d3d56042423c8bd6f5b39c1168ee5aba0 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Wed, 26 Aug 2020 16:58:51 +0100 Subject: [PATCH] Get per-monitor resolution list while SDL is alive --- apps/launcher/graphicspage.cpp | 4 +++- apps/launcher/graphicspage.hpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index c1a9461455..c745332dc8 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -71,8 +71,10 @@ bool Launcher::GraphicsPage::setupSDL() } screenComboBox->clear(); + mResolutionsPerScreen.clear(); for (int i = 0; i < displays; i++) { + mResolutionsPerScreen.append(getAvailableResolutions(i)); screenComboBox->addItem(QString(tr("Screen ")) + QString::number(i + 1)); } screenChanged(0); @@ -332,7 +334,7 @@ void Launcher::GraphicsPage::screenChanged(int screen) { if (screen >= 0) { resolutionComboBox->clear(); - resolutionComboBox->addItems(getAvailableResolutions(screen)); + resolutionComboBox->addItems(mResolutionsPerScreen[screen]); } } diff --git a/apps/launcher/graphicspage.hpp b/apps/launcher/graphicspage.hpp index 4ce5b584f0..3b03a72bdd 100644 --- a/apps/launcher/graphicspage.hpp +++ b/apps/launcher/graphicspage.hpp @@ -38,6 +38,8 @@ namespace Launcher Files::ConfigurationManager &mCfgMgr; Settings::Manager &mEngineSettings; + QVector mResolutionsPerScreen; + static QStringList getAvailableResolutions(int screen); static QRect getMaximumResolution();