initialstart: Port libkscreen usage after isPrimary was removed

https://invent.kde.org/plasma/libkscreen/-/merge_requests/265 removed
isPrimary
This commit is contained in:
Devin Lin 2025-12-04 22:07:40 -05:00
parent c2857422db
commit 1bdd4bf1ee

View file

@ -36,14 +36,15 @@ void PrepareUtil::initKScreen(std::function<void()> callback)
// To determine the scaling value: // To determine the scaling value:
// Try to take the primary display's scaling, otherwise use the scaling of any of the displays // Try to take the primary display's scaling, otherwise use the scaling of any of the displays
int lowestPriority = std::numeric_limits<unsigned int>::max();
for (KScreen::OutputPtr output : m_config->outputs()) { for (KScreen::OutputPtr output : m_config->outputs()) {
if (!output) { if (!output) {
continue; continue;
} }
scaling = output->scale() * 100; if (output->priority() <= lowestPriority) {
m_output = output->id(); lowestPriority = output->priority();
if (output->isPrimary()) { scaling = output->scale() * 100;
break; m_output = output->id();
} }
} }