* @brief Return the serialized layout JSON from WindowManager. */
| 461 | * @brief Return the serialized layout JSON from WindowManager. |
| 462 | */ |
| 463 | API::CommandResponse API::Handlers::WindowHandler::getLayout(const QString& id, |
| 464 | const QJsonObject& params) |
| 465 | { |
| 466 | Q_UNUSED(params) |
| 467 | |
| 468 | auto* wm = UI::UISessionRegistry::instance().primaryWindowManager(); |
| 469 | if (!wm) |
| 470 | return noSession(id); |
| 471 | |
| 472 | const QJsonObject layout = wm->serializeLayout(); |
| 473 | |
| 474 | QJsonObject result; |
| 475 | result[QStringLiteral("layout")] = layout; |
| 476 | return CommandResponse::makeSuccess(id, result); |
| 477 | } |
| 478 | |
| 479 | /** |
| 480 | * @brief Apply a layout to the WindowManager. |
nothing calls this directly
no test coverage detected