[Spice-devel] [PATCH vdagent-win] vdagent: enable disabled monitor with default resolution

Arnon Gilboa agilboa at redhat.com
Thu Apr 18 10:58:30 PDT 2013


When enabling a disabled monitor, init_dev_mod() "failed to create DC",
and therefore due to the custom resolution received, in set_displays()
"No suitable mode found for display".

Enabling with standard resoultion (800*600) solves the issue.

rhbz #910634
---
 vdagent/vdagent.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
index 24fe1f7..e2efb4e 100644
--- a/vdagent/vdagent.cpp
+++ b/vdagent/vdagent.cpp
@@ -672,6 +672,11 @@ bool VDAgent::handle_mon_config(VDAgentMonitorsConfig* mon_config, uint32_t port
         VDAgentMonConfig* mon = &mon_config->monitors[i];
         vd_printf("%d. %u*%u*%u (%d,%d) %u", i, mon->width, mon->height, mon->depth, mon->x,
                   mon->y, !!(mon_config->flags & VD_AGENT_CONFIG_MONITORS_FLAG_USE_POS));
+        if (!mode->get_attached()) {
+            vd_printf("%d. enable as 800*600");
+            mon->width = 800;
+            mon->height = 600;
+        }
         mode->set_res(mon->width, mon->height, mon->depth);
         if (mon_config->flags & VD_AGENT_CONFIG_MONITORS_FLAG_USE_POS) {
             mode->set_pos(mon->x, mon->y);
-- 
1.7.7.6



More information about the Spice-devel mailing list