Feature: Web remote desktop cursor sync with remote host
This commit is contained in:
@@ -1475,6 +1475,27 @@ void CWebService::NotifyResolutionChange(uint64_t device_id, int width, int heig
|
||||
}
|
||||
}
|
||||
|
||||
void CWebService::BroadcastCursor(uint64_t device_id, uint8_t cursor_index) {
|
||||
if (m_bStopping) return;
|
||||
|
||||
// Build JSON message
|
||||
Json::Value res;
|
||||
res["cmd"] = "cursor";
|
||||
res["index"] = cursor_index;
|
||||
|
||||
Json::StreamWriterBuilder builder;
|
||||
builder["indentation"] = "";
|
||||
std::string json = Json::writeString(builder, res);
|
||||
|
||||
// Send to all watching clients
|
||||
std::lock_guard<std::mutex> lock(m_ClientsMutex);
|
||||
for (auto& [ws_ptr, client] : m_Clients) {
|
||||
if (client.watch_device_id == device_id) {
|
||||
SendText(ws_ptr, json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CWebService::StartRemoteDesktop(uint64_t device_id) {
|
||||
if (!m_pParentDlg) return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user