Feature: Capture the virtual desktop for multi-monitor remote control

The MCP Observe/Act loop requires screenshots and mouse injection to share
one coordinate space. Previously the client sent only the primary monitor
while injection used virtual-desktop coordinates, so multi-monitor hosts
were rejected outright.

- Client: COMMAND_SCREEN_SPY param buffer[11] (wire index 12) now forces
  whole-virtual-desktop GDI capture; preview JPEGs also cover the virtual
  desktop including negative origins.
- Server: advertise CLIENT_CAP_VIRTUAL_DESKTOP, gate multi-monitor remote
  control on that capability, and pass the flag when starting the session.
  Linux stays exempt (X root capture/injection are already consistent).
This commit was merged in pull request #7.
This commit is contained in:
yuanyuanxiang committed 2026-11-10 08:21:55 +01:00
1 parent 5bb24d714a
commit 5eb44307ee
11 files changed
+93 -48

No files matched your search

+6 -1
View File
@@ -2389,7 +2389,7 @@ void CWebService::NotifyClipboardText(uint64_t device_id, const std::string& tex
}
}
bool CWebService::StartRemoteDesktop(uint64_t device_id) {
bool CWebService::StartRemoteDesktop(uint64_t device_id, bool forceVirtualDesktop) {
if (!m_pParentDlg) return false;
context* ctx = m_pParentDlg->FindHost(device_id);
@@ -2439,6 +2439,11 @@ bool CWebService::StartRemoteDesktop(uint64_t device_id) {
bToken[1] = 0; // DXGI mode: 0=GDI
bToken[2] = ALGORITHM_H264; // H264 algorithm
bToken[3] = 1; // Multi-screen: true
// 参数 buffer[11](wire 索引 12):强制抓整个虚拟桌面。客户端把 token 剥掉命令字节后
// 按 buffer[i]=bToken[i+1] 索引,且 buffer[3..10](wire [4..11])是 HWND,
// 不能占用。老客户端会忽略该字节,服务端只在客户端声明
// CLIENT_CAP_VIRTUAL_DESKTOP 时置位。
bToken[12] = forceVirtualDesktop ? 1 : 0;
return ctx->Send2Client(bToken, sizeof(bToken)) != FALSE;
}