[win32/vd_agent 4/4] make display disconnection persistent

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

 



https://bugzilla.redhat.com/show_bug.cgi?id=1477191
Currently on Win10 when one of multiple displays is
disconnected by the client, the qxl-wddm-dod driver
does not receive any update, the system just stops using
this adapter for rendering. As a result, the 'disconnected'
state of the adapter is not saved anywhere. On further
connect the client side recognize the adapter as active
and opens window for it. Current commit fixes the problem
by sending QXL_ESCAPE_MONITOR_CONFIG with zero area
to disabled adapter.

Signed-off-by: Yuri Benditovich <yuri.benditovich@xxxxxxxxxx>
---
 vdagent/display_configuration.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/vdagent/display_configuration.cpp b/vdagent/display_configuration.cpp
index 4577db2..50b636a 100644
--- a/vdagent/display_configuration.cpp
+++ b/vdagent/display_configuration.cpp
@@ -1007,10 +1007,14 @@ void CCD::update_detached_primary_state(LPCTSTR device_name, DISPLAYCONFIG_PATH_
 
     //will need to reset monitor positions if primary detached
     path_info->flags = path_info->flags & ~DISPLAYCONFIG_PATH_ACTIVE;
-    if (!mode|| mode->sourceMode.position.x != 0 || mode->sourceMode.position.y != 0) {
+    if (!mode) {
+        vd_printf("for inactive %S nothing to do", device_name);
         return ;
     }
-    _primary_detached = true;
+    _wddm.turn_monitor_off(device_name);
+    if (mode->sourceMode.position.x == 0 || mode->sourceMode.position.y == 0) {
+        _primary_detached = true;
+    }
 }
 
 bool CCD::set_path_state(LPCTSTR device_name, MONITOR_STATE new_state)
-- 
2.16.1.windows.4

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




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