Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_output.cpp
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Line(s) | |||||
181 | { | 181 | { | ||
182 | auto orient = orientation(); | 182 | auto orient = orientation(); | ||
183 | if (orient == Qt::PortraitOrientation || orient == Qt::InvertedPortraitOrientation) { | 183 | if (orient == Qt::PortraitOrientation || orient == Qt::InvertedPortraitOrientation) { | ||
184 | return QSize(m_mode.vdisplay, m_mode.hdisplay); | 184 | return QSize(m_mode.vdisplay, m_mode.hdisplay); | ||
185 | } | 185 | } | ||
186 | return QSize(m_mode.hdisplay, m_mode.vdisplay); | 186 | return QSize(m_mode.hdisplay, m_mode.vdisplay); | ||
187 | } | 187 | } | ||
188 | 188 | | |||
189 | void DrmOutput::setEnabled(bool enabled) | | |||
190 | { | | |||
191 | if (enabled == isEnabled()) { | | |||
192 | return; | | |||
193 | } | | |||
194 | if (enabled) { | | |||
195 | updateDpms(KWayland::Server::OutputInterface::DpmsMode::On); | | |||
196 | initWaylandOutput(); | | |||
197 | } else { | | |||
198 | updateDpms(KWayland::Server::OutputInterface::DpmsMode::Off); | | |||
199 | delete waylandOutput().data(); | | |||
200 | } | | |||
201 | waylandOutputDevice()->setEnabled(enabled ? | | |||
202 | KWayland::Server::OutputDeviceInterface::Enablement::Enabled : KWayland::Server::OutputDeviceInterface::Enablement::Disabled); | | |||
203 | } | | |||
204 | | ||||
205 | static KWayland::Server::OutputInterface::DpmsMode toWaylandDpmsMode(DrmOutput::DpmsMode mode) | 189 | static KWayland::Server::OutputInterface::DpmsMode toWaylandDpmsMode(DrmOutput::DpmsMode mode) | ||
206 | { | 190 | { | ||
207 | using namespace KWayland::Server; | 191 | using namespace KWayland::Server; | ||
208 | switch (mode) { | 192 | switch (mode) { | ||
209 | case DrmOutput::DpmsMode::On: | 193 | case DrmOutput::DpmsMode::On: | ||
210 | return OutputInterface::DpmsMode::On; | 194 | return OutputInterface::DpmsMode::On; | ||
211 | case DrmOutput::DpmsMode::Standby: | 195 | case DrmOutput::DpmsMode::Standby: | ||
212 | return OutputInterface::DpmsMode::Standby; | 196 | return OutputInterface::DpmsMode::Standby; | ||
▲ Show 20 Lines • Show All 990 Lines • Show Last 20 Lines |