Changeset View
Changeset View
Standalone View
Standalone View
backends/kwayland/waylandconfig.cpp
Show First 20 Lines • Show All 230 Lines • ▼ Show 20 Line(s) | 227 | { | |||
---|---|---|---|---|---|
231 | delete output; | 231 | delete output; | ||
232 | if (!m_blockSignals) { | 232 | if (!m_blockSignals) { | ||
233 | Q_EMIT configChanged(toKScreenConfig()); | 233 | Q_EMIT configChanged(toKScreenConfig()); | ||
234 | } | 234 | } | ||
235 | } | 235 | } | ||
236 | 236 | | |||
237 | void WaylandConfig::updateKScreenConfig(KScreen::ConfigPtr &config) const | 237 | void WaylandConfig::updateKScreenConfig(KScreen::ConfigPtr &config) const | ||
238 | { | 238 | { | ||
239 | auto features = Config::Feature::Writable; | 239 | auto features = Config::Feature::Writable | Config::Feature::PerOutputScaling; | ||
240 | config->setSupportedFeatures(features); | 240 | config->setSupportedFeatures(features); | ||
241 | config->setValid(m_connection->display()); | 241 | config->setValid(m_connection->display()); | ||
242 | KScreen::ScreenPtr screen = config->screen(); | 242 | KScreen::ScreenPtr screen = config->screen(); | ||
243 | m_screen->updateKScreenScreen(screen); | 243 | m_screen->updateKScreenScreen(screen); | ||
244 | 244 | | |||
245 | //Removing removed outputs | 245 | //Removing removed outputs | ||
246 | const KScreen::OutputList outputs = config->outputs(); | 246 | const KScreen::OutputList outputs = config->outputs(); | ||
247 | Q_FOREACH (const KScreen::OutputPtr &output, outputs) { | 247 | Q_FOREACH (const KScreen::OutputPtr &output, outputs) { | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 290 | if (old_enabled != output->isEnabled()) { | |||
292 | wlOutputConfiguration->setEnabled(o_old->outputDevice(), _enablement); | 292 | wlOutputConfiguration->setEnabled(o_old->outputDevice(), _enablement); | ||
293 | } | 293 | } | ||
294 | 294 | | |||
295 | // position | 295 | // position | ||
296 | if (device->globalPosition() != output->pos()) { | 296 | if (device->globalPosition() != output->pos()) { | ||
297 | wlOutputConfiguration->setPosition(o_old->outputDevice(), output->pos()); | 297 | wlOutputConfiguration->setPosition(o_old->outputDevice(), output->pos()); | ||
298 | } | 298 | } | ||
299 | 299 | | |||
300 | if (device->scale() != output->scale()) { | ||||
301 | wlOutputConfiguration->setScale(o_old->outputDevice(), output->scale()); | ||||
302 | } | ||||
303 | | ||||
300 | // rotation | 304 | // rotation | ||
301 | auto r_current = o_old->toKScreenRotation(device->transform()); | 305 | auto r_current = o_old->toKScreenRotation(device->transform()); | ||
302 | auto r_new = output->rotation(); | 306 | auto r_new = output->rotation(); | ||
303 | if (r_current != r_new) { | 307 | if (r_current != r_new) { | ||
304 | wlOutputConfiguration->setTransform(device, o_old->toKWaylandTransform(r_new)); | 308 | wlOutputConfiguration->setTransform(device, o_old->toKWaylandTransform(r_new)); | ||
305 | } | 309 | } | ||
306 | 310 | | |||
307 | // mode | 311 | // mode | ||
308 | int w_currentmodeid = device->currentMode().id; | 312 | int w_currentmodeid = device->currentMode().id; | ||
309 | QString l_newmodeid = output->currentModeId(); | 313 | QString l_newmodeid = output->currentModeId(); | ||
310 | int w_newmodeid = o_old->toKWaylandModeId(l_newmodeid); | 314 | int w_newmodeid = o_old->toKWaylandModeId(l_newmodeid); | ||
311 | if (w_newmodeid != w_currentmodeid) { | 315 | if (w_newmodeid != w_currentmodeid) { | ||
312 | wlOutputConfiguration->setMode(device, w_newmodeid); | 316 | wlOutputConfiguration->setMode(device, w_newmodeid); | ||
313 | } | 317 | } | ||
314 | | ||||
315 | // FIXME: scale | | |||
316 | } | 318 | } | ||
317 | 319 | | |||
318 | // We now block changes in order to compress events while the compositor is doing its thing | 320 | // We now block changes in order to compress events while the compositor is doing its thing | ||
319 | // once it's done or failed, we'll trigger configChanged() only once, and not per individual | 321 | // once it's done or failed, we'll trigger configChanged() only once, and not per individual | ||
320 | // property change. | 322 | // property change. | ||
321 | connect(wlOutputConfiguration, &OutputConfiguration::applied, this, [this, wlOutputConfiguration] { | 323 | connect(wlOutputConfiguration, &OutputConfiguration::applied, this, [this, wlOutputConfiguration] { | ||
322 | wlOutputConfiguration->deleteLater(); | 324 | wlOutputConfiguration->deleteLater(); | ||
323 | unblockSignals(); | 325 | unblockSignals(); | ||
Show All 11 Lines |