Changeset View
Changeset View
Standalone View
Standalone View
backends/kwayland/waylandscreen.cpp
Show All 40 Lines | |||||
41 | 41 | | |||
42 | void WaylandScreen::setOutputs(const QList<WaylandOutput*> &outputs) | 42 | void WaylandScreen::setOutputs(const QList<WaylandOutput*> &outputs) | ||
43 | { | 43 | { | ||
44 | m_outputCount = outputs.count(); | 44 | m_outputCount = outputs.count(); | ||
45 | 45 | | |||
46 | QRect r; | 46 | QRect r; | ||
47 | for (const auto *out : outputs) { | 47 | for (const auto *out : outputs) { | ||
48 | if (out->enabled()) { | 48 | if (out->enabled()) { | ||
49 | const auto *dev = out->outputDevice(); | 49 | r |= out->geometry().toRect(); | ||
50 | r |= QRect(dev->globalPosition(), dev->pixelSize() / dev->scale()); | | |||
51 | } | 50 | } | ||
52 | } | 51 | } | ||
53 | m_size = r.size(); | 52 | m_size = r.size(); | ||
54 | } | 53 | } | ||
55 | 54 | | |||
56 | void WaylandScreen::updateKScreenScreen(KScreen::ScreenPtr &screen) const | 55 | void WaylandScreen::updateKScreenScreen(KScreen::ScreenPtr &screen) const | ||
57 | { | 56 | { | ||
58 | screen->setMinSize(QSize(0, 0)); | 57 | screen->setMinSize(QSize(0, 0)); | ||
59 | 58 | | |||
60 | // 64000^2 should be enough for everyone. | 59 | // 64000^2 should be enough for everyone. | ||
61 | screen->setMaxSize(QSize(64000, 64000)); | 60 | screen->setMaxSize(QSize(64000, 64000)); | ||
62 | 61 | | |||
63 | screen->setCurrentSize(m_size); | 62 | screen->setCurrentSize(m_size); | ||
64 | screen->setMaxActiveOutputsCount(m_outputCount); | 63 | screen->setMaxActiveOutputsCount(m_outputCount); | ||
65 | } | 64 | } | ||
66 | 65 | |