mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
initialstart: Port libkscreen usage after isPrimary was removed
https://invent.kde.org/plasma/libkscreen/-/merge_requests/265 removed isPrimary
This commit is contained in:
parent
c2857422db
commit
1bdd4bf1ee
1 changed files with 5 additions and 4 deletions
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue