Changeset View
Changeset View
Standalone View
Standalone View
abstract_wayland_output.cpp
Show All 12 Lines | |||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "abstract_wayland_output.h" | 20 | #include "abstract_wayland_output.h" | ||
21 | | ||||
22 | #include <wayland_logging.h> | ||||
21 | #include "wayland_server.h" | 23 | #include "wayland_server.h" | ||
22 | 24 | | |||
23 | // KWayland | 25 | // KWayland | ||
24 | #include <KWayland/Server/display.h> | 26 | #include <KWayland/Server/display.h> | ||
25 | #include <KWayland/Server/outputchangeset.h> | 27 | #include <KWayland/Server/outputchangeset.h> | ||
26 | #include <KWayland/Server/xdgoutput_interface.h> | 28 | #include <KWayland/Server/xdgoutput_interface.h> | ||
27 | // KF5 | 29 | // KF5 | ||
28 | #include <KLocalizedString> | 30 | #include <KLocalizedString> | ||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 105 | if (isEnabled()) { | |||
110 | m_waylandOutput->setScale(std::ceil(scale)); | 112 | m_waylandOutput->setScale(std::ceil(scale)); | ||
111 | m_xdgOutput->setLogicalSize(pixelSize() / scale); | 113 | m_xdgOutput->setLogicalSize(pixelSize() / scale); | ||
112 | m_xdgOutput->done(); | 114 | m_xdgOutput->done(); | ||
113 | } | 115 | } | ||
114 | } | 116 | } | ||
115 | 117 | | |||
116 | void AbstractWaylandOutput::applyChanges(const KWayland::Server::OutputChangeSet *changeSet) | 118 | void AbstractWaylandOutput::applyChanges(const KWayland::Server::OutputChangeSet *changeSet) | ||
117 | { | 119 | { | ||
118 | qCDebug(KWIN_CORE) << "Apply changes to the Wayland output."; | 120 | qCDebug(KWIN_WL) << "Apply changes to the Wayland output."; | ||
119 | bool emitModeChanged = false; | 121 | bool emitModeChanged = false; | ||
120 | 122 | | |||
121 | // Enablement changes are handled by platform. | 123 | // Enablement changes are handled by platform. | ||
122 | if (changeSet->modeChanged()) { | 124 | if (changeSet->modeChanged()) { | ||
123 | qCDebug(KWIN_CORE) << "Setting new mode:" << changeSet->mode(); | 125 | qCDebug(KWIN_WL) << "Setting new mode:" << changeSet->mode(); | ||
124 | m_waylandOutputDevice->setCurrentMode(changeSet->mode()); | 126 | m_waylandOutputDevice->setCurrentMode(changeSet->mode()); | ||
125 | updateMode(changeSet->mode()); | 127 | updateMode(changeSet->mode()); | ||
126 | emitModeChanged = true; | 128 | emitModeChanged = true; | ||
127 | } | 129 | } | ||
128 | if (changeSet->transformChanged()) { | 130 | if (changeSet->transformChanged()) { | ||
129 | qCDebug(KWIN_CORE) << "Server setting transform: " << (int)(changeSet->transform()); | 131 | qCDebug(KWIN_WL) << "Server setting transform: " << (int)(changeSet->transform()); | ||
130 | transform(changeSet->transform()); | 132 | transform(changeSet->transform()); | ||
131 | emitModeChanged = true; | 133 | emitModeChanged = true; | ||
132 | } | 134 | } | ||
133 | if (changeSet->positionChanged()) { | 135 | if (changeSet->positionChanged()) { | ||
134 | qCDebug(KWIN_CORE) << "Server setting position: " << changeSet->position(); | 136 | qCDebug(KWIN_WL) << "Server setting position: " << changeSet->position(); | ||
135 | setGlobalPos(changeSet->position()); | 137 | setGlobalPos(changeSet->position()); | ||
136 | // may just work already! | 138 | // may just work already! | ||
137 | } | 139 | } | ||
138 | if (changeSet->scaleChanged()) { | 140 | if (changeSet->scaleChanged()) { | ||
139 | qCDebug(KWIN_CORE) << "Setting scale:" << changeSet->scale(); | 141 | qCDebug(KWIN_WL) << "Setting scale:" << changeSet->scale(); | ||
140 | setScale(changeSet->scaleF()); | 142 | setScale(changeSet->scaleF()); | ||
141 | emitModeChanged = true; | 143 | emitModeChanged = true; | ||
142 | } | 144 | } | ||
143 | 145 | | |||
144 | if (emitModeChanged) { | 146 | if (emitModeChanged) { | ||
145 | emit modeChanged(); | 147 | emit modeChanged(); | ||
146 | } | 148 | } | ||
147 | } | 149 | } | ||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | 248 | } else { | |||
247 | m_waylandOutputDevice->setManufacturer(i18n("unknown")); | 249 | m_waylandOutputDevice->setManufacturer(i18n("unknown")); | ||
248 | } | 250 | } | ||
249 | 251 | | |||
250 | m_waylandOutputDevice->setModel(model); | 252 | m_waylandOutputDevice->setModel(model); | ||
251 | m_waylandOutputDevice->setPhysicalSize(physicalSize); | 253 | m_waylandOutputDevice->setPhysicalSize(physicalSize); | ||
252 | 254 | | |||
253 | int i = 0; | 255 | int i = 0; | ||
254 | for (auto mode : modes) { | 256 | for (auto mode : modes) { | ||
255 | qCDebug(KWIN_CORE).nospace() << "Adding mode " << ++i << ": " << mode.size << " [" << mode.refreshRate << "]"; | 257 | qCDebug(KWIN_WL).nospace() << "Adding mode " << ++i << ": " << mode.size << " [" << mode.refreshRate << "]"; | ||
256 | m_waylandOutputDevice->addMode(mode); | 258 | m_waylandOutputDevice->addMode(mode); | ||
257 | } | 259 | } | ||
258 | 260 | | |||
259 | m_waylandOutputDevice->create(); | 261 | m_waylandOutputDevice->create(); | ||
260 | createWaylandOutput(); | 262 | createWaylandOutput(); | ||
261 | } | 263 | } | ||
262 | 264 | | |||
263 | QSize AbstractWaylandOutput::orientateSize(const QSize &size) const | 265 | QSize AbstractWaylandOutput::orientateSize(const QSize &size) const | ||
264 | { | 266 | { | ||
265 | if (m_orientation == Qt::PortraitOrientation || m_orientation == Qt::InvertedPortraitOrientation) { | 267 | if (m_orientation == Qt::PortraitOrientation || m_orientation == Qt::InvertedPortraitOrientation) { | ||
266 | return size.transposed(); | 268 | return size.transposed(); | ||
267 | } | 269 | } | ||
268 | return size; | 270 | return size; | ||
269 | } | 271 | } | ||
270 | 272 | | |||
271 | } | 273 | } |