| 1952 | } |
| 1953 | |
| 1954 | nlohmann::json CloudTunnel::ResizeRemoteSession(const std::string& vm_id, const nlohmann::json& payload) { |
| 1955 | const std::string session_id = payload.value("session_id", ""); |
| 1956 | auto session = remote_sessions_.GetByVm(vm_id); |
| 1957 | if (!session || session->session_id != session_id) { |
| 1958 | return Error("remote_session_not_found", "remote session not found"); |
| 1959 | } |
| 1960 | const uint32_t width = AlignDisplaySize(payload.value("width", static_cast<uint32_t>(1280))); |
| 1961 | const uint32_t height = AlignDisplaySize(payload.value("height", static_cast<uint32_t>(720))); |
| 1962 | if (!runtime_manager_.SetDisplaySize(vm_id, width, height)) { |
| 1963 | return Error("runtime_not_attached", "failed to resize runtime display"); |
| 1964 | } |
| 1965 | return {{"session_id", session_id}, {"width", width}, {"height", height}}; |
| 1966 | } |
| 1967 | |
| 1968 | nlohmann::json CloudTunnel::CloseRemoteSession(const std::string& vm_id, const nlohmann::json& payload) { |
| 1969 | const std::string session_id = payload.value("session_id", ""); |
nothing calls this directly
no test coverage detected