Changeset View
Changeset View
Standalone View
Standalone View
abstract_wayland_output.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
47 | QString AbstractWaylandOutput::name() const | 47 | QString AbstractWaylandOutput::name() const | ||
48 | { | 48 | { | ||
49 | if (!m_waylandOutput) { | 49 | if (!m_waylandOutput) { | ||
50 | return i18n("unknown"); | 50 | return i18n("unknown"); | ||
51 | } | 51 | } | ||
52 | return QStringLiteral("%1 %2").arg(m_waylandOutput->manufacturer()).arg(m_waylandOutput->model()); | 52 | return QStringLiteral("%1 %2").arg(m_waylandOutput->manufacturer()).arg(m_waylandOutput->model()); | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | QByteArray AbstractWaylandOutput::uuid() const | ||||
56 | { | ||||
57 | return m_waylandOutputDevice->uuid(); | ||||
58 | } | ||||
59 | | ||||
55 | QRect AbstractWaylandOutput::geometry() const | 60 | QRect AbstractWaylandOutput::geometry() const | ||
56 | { | 61 | { | ||
57 | return QRect(globalPos(), pixelSize() / scale()); | 62 | return QRect(globalPos(), pixelSize() / scale()); | ||
58 | } | 63 | } | ||
59 | 64 | | |||
60 | QSize AbstractWaylandOutput::physicalSize() const | 65 | QSize AbstractWaylandOutput::physicalSize() const | ||
61 | { | 66 | { | ||
62 | return orientateSize(m_waylandOutputDevice->physicalSize()); | 67 | return orientateSize(m_waylandOutputDevice->physicalSize()); | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 110 | if (m_waylandOutput) { | |||
112 | m_waylandOutput->setScale(std::ceil(scale)); | 117 | m_waylandOutput->setScale(std::ceil(scale)); | ||
113 | } | 118 | } | ||
114 | if (m_xdgOutput) { | 119 | if (m_xdgOutput) { | ||
115 | m_xdgOutput->setLogicalSize(pixelSize() / scale); | 120 | m_xdgOutput->setLogicalSize(pixelSize() / scale); | ||
116 | m_xdgOutput->done(); | 121 | m_xdgOutput->done(); | ||
117 | } | 122 | } | ||
118 | } | 123 | } | ||
119 | 124 | | |||
120 | void AbstractWaylandOutput::setChanges(KWayland::Server::OutputChangeSet *changes) | 125 | void AbstractWaylandOutput::applyChanges(const KWayland::Server::OutputChangeSet *changeSet) | ||
121 | { | 126 | { | ||
122 | qCDebug(KWIN_CORE) << "Set changes in AbstractWaylandOutput."; | 127 | qCDebug(KWIN_CORE) << "Apply changes to the Wayland output."; | ||
123 | bool emitModeChanged = false; | 128 | bool emitModeChanged = false; | ||
124 | 129 | | |||
125 | //enabledChanged is handled by plugin code | 130 | // Enablement changes are handled by platform. | ||
126 | if (changes->modeChanged()) { | 131 | if (changeSet->modeChanged()) { | ||
127 | qCDebug(KWIN_CORE) << "Setting new mode:" << changes->mode(); | 132 | qCDebug(KWIN_CORE) << "Setting new mode:" << changeSet->mode(); | ||
128 | m_waylandOutputDevice->setCurrentMode(changes->mode()); | 133 | m_waylandOutputDevice->setCurrentMode(changeSet->mode()); | ||
129 | updateMode(changes->mode()); | 134 | updateMode(changeSet->mode()); | ||
130 | emitModeChanged = true; | 135 | emitModeChanged = true; | ||
131 | } | 136 | } | ||
132 | if (changes->transformChanged()) { | 137 | if (changeSet->transformChanged()) { | ||
133 | qCDebug(KWIN_CORE) << "Server setting transform: " << (int)(changes->transform()); | 138 | qCDebug(KWIN_CORE) << "Server setting transform: " << (int)(changeSet->transform()); | ||
134 | transform(changes->transform()); | 139 | transform(changeSet->transform()); | ||
135 | emitModeChanged = true; | 140 | emitModeChanged = true; | ||
136 | } | 141 | } | ||
137 | if (changes->positionChanged()) { | 142 | if (changeSet->positionChanged()) { | ||
138 | qCDebug(KWIN_CORE) << "Server setting position: " << changes->position(); | 143 | qCDebug(KWIN_CORE) << "Server setting position: " << changeSet->position(); | ||
139 | setGlobalPos(changes->position()); | 144 | setGlobalPos(changeSet->position()); | ||
140 | // may just work already! | 145 | // may just work already! | ||
141 | } | 146 | } | ||
142 | if (changes->scaleChanged()) { | 147 | if (changeSet->scaleChanged()) { | ||
143 | qCDebug(KWIN_CORE) << "Setting scale:" << changes->scale(); | 148 | qCDebug(KWIN_CORE) << "Setting scale:" << changeSet->scale(); | ||
144 | setScale(changes->scaleF()); | 149 | setScale(changeSet->scaleF()); | ||
145 | emitModeChanged = true; | 150 | emitModeChanged = true; | ||
146 | } | 151 | } | ||
147 | 152 | | |||
148 | if (emitModeChanged) { | 153 | if (emitModeChanged) { | ||
149 | emit modeChanged(); | 154 | emit modeChanged(); | ||
150 | } | 155 | } | ||
151 | } | 156 | } | ||
152 | 157 | | |||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |