From gitlab-mirror at kemper.freedesktop.org Sun Sep 8 10:34:22 2024 From: gitlab-mirror at kemper.freedesktop.org (GitLab Mirror) Date: Sun, 8 Sep 2024 10:34:22 +0000 (UTC) Subject: vdagent/desktop_layout.cpp Message-ID: <20240908103422.2D338761A7@kemper.freedesktop.org> vdagent/desktop_layout.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) New commits: commit d7405ee0850c34a9b4e09f0a0851d3e4408fad1a Author: Benjamin H?glinger-Stelzer Date: Fri Aug 30 01:07:55 2024 +0200 Fixed issue with multiple GPUs causing mouse to not work (see https://www.spinics.net/lists/spice-devel/msg42936.html) diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp index 07074da..8b538a1 100644 --- a/vdagent/desktop_layout.cpp +++ b/vdagent/desktop_layout.cpp @@ -48,6 +48,16 @@ DesktopLayout::~DesktopLayout() delete _display_config; } +static BOOL +dev_has_monitor(DISPLAY_DEVICE &dev_info) +{ + DISPLAY_DEVICE mon_info; + + ZeroMemory(&mon_info, sizeof(mon_info)); + mon_info.cb = sizeof(mon_info); + return EnumDisplayDevices(dev_info.DeviceName, 0, &mon_info, 0); +} + static bool get_next_display(DWORD &dev_id, DISPLAY_DEVICE &dev_info) { @@ -64,6 +74,9 @@ get_next_display(DWORD &dev_id, DISPLAY_DEVICE &dev_info) if (wcsstr(dev_info.DeviceString, L"Citrix Indirect Display")) { continue; } + if (!dev_has_monitor(dev_info)) { + continue; + } return true; } return false;