[PATCH win-agent 2/2] Reattach monitors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Teach vdagent to attach monitors. A monitor needs to be enabled before
we can set the custom resolution. Fortunately, the client doesn't seem
to have time to catch that, so things are smooth.

This is require to allow the virt-viewer display menu to work properly
and enable extra monitors: https://bugzilla.redhat.com/show_bug.cgi?id=919530
---
 vdagent/desktop_layout.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp
index 7cb2f4b..bce9ac0 100644
--- a/vdagent/desktop_layout.cpp
+++ b/vdagent/desktop_layout.cpp
@@ -243,6 +243,7 @@ bool DesktopLayout::init_dev_mode(LPCTSTR dev_name, DEVMODE* dev_mode, DisplayMo
     DWORD best = -1;
     QXLEscapeSetCustomDisplay custom;
     HDC hdc = NULL;
+    LONG ret;
 
     ZeroMemory(dev_mode, sizeof(DEVMODE));
     dev_mode->dmSize = sizeof(DEVMODE);
@@ -252,6 +253,11 @@ bool DesktopLayout::init_dev_mode(LPCTSTR dev_name, DEVMODE* dev_mode, DisplayMo
         return true;
     }
 
+    // attach
+    EnumDisplaySettings(dev_name, ENUM_CURRENT_SETTINGS, dev_mode);
+    ret = ChangeDisplaySettingsEx(dev_name, dev_mode, NULL, CDS_UPDATEREGISTRY, NULL);
+    vd_printf("attach %d", ret);
+
     // Update custom resolution
     custom.xres = mode->_width;
     custom.yres = mode->_height;
-- 
1.8.1.1.439.g50a6b54

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]