From 8c1e2cffda762fef83ea48658a08847382c71486 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 5 May 2022 18:22:46 +0200 Subject: [PATCH 1/2] kcm: fix refresh rate list not being updated BUG: 453392 --- kcm/output_model.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kcm/output_model.cpp b/kcm/output_model.cpp index cd47e2d..b0f7f6d 100644 --- a/kcm/output_model.cpp +++ b/kcm/output_model.cpp @@ -417,7 +417,7 @@ bool OutputModel::setResolution(int outputIndex, int resIndex) QModelIndex index = createIndex(outputIndex, 0); // Calling this directly ignores possible optimization when the // refresh rate hasn't changed in fact. But that's ok. - Q_EMIT dataChanged(index, index, {ResolutionIndexRole, ResolutionRole, SizeRole, RefreshRateIndexRole}); + Q_EMIT dataChanged(index, index, {ResolutionIndexRole, ResolutionRole, SizeRole, RefreshRatesRole, RefreshRateIndexRole}); Q_EMIT sizeChanged(); return true; } -- GitLab From 5e1be88dbe6e5160dcc232631df81d9bdc9d179e Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 5 May 2022 18:27:38 +0200 Subject: [PATCH 2/2] kcm: fix choosing the refresh rate It always chose the last one, and not the highest one --- kcm/output_model.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/kcm/output_model.cpp b/kcm/output_model.cpp index b0f7f6d..bfbfe1d 100644 --- a/kcm/output_model.cpp +++ b/kcm/output_model.cpp @@ -394,6 +394,7 @@ bool OutputModel::setResolution(int outputIndex, int resIndex) auto it = modes.begin(); while (it != modes.end()) { if ((*it)->size() == size && (*it)->refreshRate() > bestRefreshRate) { + bestRefreshRate = (*it)->refreshRate(); modeIt = it; } it++; -- GitLab