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

+9
View File
@@ -105,6 +105,15 @@ public:
return (strtoul(caps.GetString(), nullptr, 16) & CLIENT_CAP_SCREEN_PREVIEW) != 0;
}
// 检查客户端是否支持强制抓取整个虚拟桌面(COMMAND_SCREEN_SPY 参数 buffer[11],
// 即 wire 索引 12;wire [4..11] 是 HWND,不能占用)。
// 多显示器远程控制依赖它:截图与注入共用虚拟桌面坐标系。
bool SupportsVirtualDesktop() const {
CString caps = GetClientData(ONLINELIST_CAPABILITIES);
if (caps.IsEmpty()) return false;
return (strtoul(caps.GetString(), nullptr, 16) & CLIENT_CAP_VIRTUAL_DESKTOP) != 0;
}
// 检查客户端是否支持远程协议切换(COMMAND_SET_PROTO)。老客户端没有这个命令,
// 收到也会走 default 丢弃,服务端据此把「协议切换」菜单置灰。
bool SupportsProtoSwitch() const {