plugins/outputlocator: show physical size in output locator

Make sure the effect shows the same sizes as the KScreen KCM.
This commit is contained in:
Fushan Wen 2024-02-28 23:25:48 +08:00 committed by Vlad Zahorodnii
parent bd88801de4
commit d377b5cdab

View file

@ -79,7 +79,7 @@ void OutputLocatorEffect::show()
const auto screens = effects->screens();
for (const auto screen : screens) {
auto scene = new OffscreenQuickScene();
scene->setSource(m_qmlUrl, {{QStringLiteral("outputName"), outputName(screen)}, {QStringLiteral("resolution"), screen->geometry().size()}, {QStringLiteral("scale"), screen->scale()}});
scene->setSource(m_qmlUrl, {{QStringLiteral("outputName"), outputName(screen)}, {QStringLiteral("resolution"), screen->pixelSize()}, {QStringLiteral("scale"), screen->scale()}});
QRectF geometry(0, 0, scene->rootItem()->implicitWidth(), scene->rootItem()->implicitHeight());
geometry.moveCenter(screen->geometry().center());
scene->setGeometry(geometry.toRect());