summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2017-05-04 17:14:53 +0200
committerDavid Edmundson <[email protected]>2017-05-04 17:18:03 +0200
commita066f07dfd2b6129667d02516dceedfff3993c7c (patch)
tree5c867e45bacca9f6070191678dcf5ec16287ae36
parentcd4f61871bbf74882c3823d68b0a3fec47613f44 (diff)
Sync kscreen outputs to wayland
Test Plan: Used from fixed KScreen KCM. Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5710
-rw-r--r--backends/kwayland/waylandconfig.cpp8
-rw-r--r--backends/kwayland/waylandscreen.cpp2
2 files changed, 6 insertions, 4 deletions
diff --git a/backends/kwayland/waylandconfig.cpp b/backends/kwayland/waylandconfig.cpp
index dee65db..f9c89d1 100644
--- a/backends/kwayland/waylandconfig.cpp
+++ b/backends/kwayland/waylandconfig.cpp
@@ -236,7 +236,7 @@ void WaylandConfig::removeOutput(quint32 name)
void WaylandConfig::updateKScreenConfig(KScreen::ConfigPtr &config) const
{
- auto features = Config::Feature::Writable;
+ auto features = Config::Feature::Writable | Config::Feature::PerOutputScaling;
config->setSupportedFeatures(features);
config->setValid(m_connection->display());
KScreen::ScreenPtr screen = config->screen();
@@ -297,6 +297,10 @@ void WaylandConfig::applyConfig(const KScreen::ConfigPtr &newConfig)
wlOutputConfiguration->setPosition(o_old->outputDevice(), output->pos());
}
+ if (device->scale() != output->scale()) {
+ wlOutputConfiguration->setScale(o_old->outputDevice(), output->scale());
+ }
+
// rotation
auto r_current = o_old->toKScreenRotation(device->transform());
auto r_new = output->rotation();
@@ -311,8 +315,6 @@ void WaylandConfig::applyConfig(const KScreen::ConfigPtr &newConfig)
if (w_newmodeid != w_currentmodeid) {
wlOutputConfiguration->setMode(device, w_newmodeid);
}
-
- // FIXME: scale
}
// We now block changes in order to compress events while the compositor is doing its thing
diff --git a/backends/kwayland/waylandscreen.cpp b/backends/kwayland/waylandscreen.cpp
index 1de94a6..f0618a0 100644
--- a/backends/kwayland/waylandscreen.cpp
+++ b/backends/kwayland/waylandscreen.cpp
@@ -49,7 +49,7 @@ void WaylandScreen::setOutputs(const QList<WaylandOutput*> outputs)
QRect r;
Q_FOREACH (auto o, outputs) {
if (o->enabled()) {
- r |= QRect(o->outputDevice()->globalPosition(), o->outputDevice()->pixelSize());
+ r |= QRect(o->outputDevice()->globalPosition(), o->outputDevice()->pixelSize() / o->outputDevice()->scale());
}
}
m_size = r.size();