Changeset View
Changeset View
Standalone View
Standalone View
kded/output.cpp
Show First 20 Lines • Show All 321 Lines • ▼ Show 20 Line(s) | 318 | if (!output->name().isEmpty() && duplicateIds.contains(outputId)) { | |||
---|---|---|---|---|---|
322 | const auto outputName = metadata[QStringLiteral("name")].toString(); | 322 | const auto outputName = metadata[QStringLiteral("name")].toString(); | ||
323 | if (output->name() != outputName) { | 323 | if (output->name() != outputName) { | ||
324 | // was a duplicate id, but info not for this output | 324 | // was a duplicate id, but info not for this output | ||
325 | continue; | 325 | continue; | ||
326 | } | 326 | } | ||
327 | } | 327 | } | ||
328 | infoFound = true; | 328 | infoFound = true; | ||
329 | readIn(output, info, control.getOutputRetention(output)); | 329 | readIn(output, info, control.getOutputRetention(output)); | ||
330 | | ||||
331 | const QString replicationSourceHash = info[QStringLiteral("replicate")].toString(); | | |||
332 | if (replicationSourceHash.isEmpty()) { | | |||
333 | output->setReplicationSource(0); | | |||
334 | } else { | | |||
335 | for (const KScreen::OutputPtr out : outputs) { | | |||
336 | if (out != output && out->hashMd5() == replicationSourceHash) { | | |||
337 | output->setReplicationSource(out->id()); | | |||
338 | break; | | |||
339 | } | | |||
340 | } | | |||
341 | } | | |||
342 | break; | 330 | break; | ||
343 | } | 331 | } | ||
344 | if (!infoFound) { | 332 | if (!infoFound) { | ||
345 | // no info in info for this output, try reading in global output info at least or set some default values | 333 | // no info in info for this output, try reading in global output info at least or set some default values | ||
346 | 334 | | |||
347 | qCWarning(KSCREEN_KDED) << "\tFailed to find a matching output in the current info data - this means that our info is corrupted" | 335 | qCWarning(KSCREEN_KDED) << "\tFailed to find a matching output in the current info data - this means that our info is corrupted" | ||
348 | "or a different device with the same serial number has been connected (very unlikely)."; | 336 | "or a different device with the same serial number has been connected (very unlikely)."; | ||
349 | if (!readInGlobal(output)) { | 337 | if (!readInGlobal(output)) { | ||
350 | // set some default values instead | 338 | // set some default values instead | ||
351 | readInGlobalPartFromInfo(output, QVariantMap()); | 339 | readInGlobalPartFromInfo(output, QVariantMap()); | ||
352 | } | 340 | } | ||
353 | } | 341 | } | ||
354 | } | 342 | } | ||
343 | | ||||
344 | for (KScreen::OutputPtr output : outputs) { | ||||
345 | auto replicationSource = control.getReplicationSource(output); | ||||
346 | if (replicationSource) { | ||||
347 | output->setPos(replicationSource->pos()); | ||||
348 | output->setLogicalSize(replicationSource->logicalSize()); | ||||
349 | } else { | ||||
350 | output->setLogicalSize(QSizeF()); | ||||
351 | } | ||||
352 | } | ||||
353 | | ||||
354 | // TODO: this does not work at the moment with logical size replication. Deactivate for now. | ||||
355 | // correct positional config regressions on global output data changes | 355 | // correct positional config regressions on global output data changes | ||
356 | #if 0 | ||||
356 | adjustPositions(config, outputsInfo); | 357 | adjustPositions(config, outputsInfo); | ||
358 | #endif | ||||
357 | } | 359 | } | ||
358 | 360 | | |||
359 | static QVariantMap metadata(const KScreen::OutputPtr &output) | 361 | static QVariantMap metadata(const KScreen::OutputPtr &output) | ||
360 | { | 362 | { | ||
361 | QVariantMap metadata; | 363 | QVariantMap metadata; | ||
362 | metadata[QStringLiteral("name")] = output->name(); | 364 | metadata[QStringLiteral("name")] = output->name(); | ||
363 | if (!output->edid() || !output->edid()->isValid()) { | 365 | if (!output->edid() || !output->edid()->isValid()) { | ||
364 | return metadata; | 366 | return metadata; | ||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |