[Spice-devel] [PATCH win-agent] desktop_layout: fix incorrect total_width/height

Marc-André Lureau marcandre.lureau at gmail.com
Fri May 18 16:03:59 PDT 2012


When resizing desktop to best match, the agent fails to update
it's current mode width/height and then incorrectly report
different total_width/total_height than real screen dimensions,
then scaling input incorrectly results in mouse cursor offset.

https://bugzilla.redhat.com/show_bug.cgi?id=823019
---
 vdagent/desktop_layout.cpp |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp
index 7564cf6..3b474d1 100644
--- a/vdagent/desktop_layout.cpp
+++ b/vdagent/desktop_layout.cpp
@@ -298,6 +298,11 @@ bool DesktopLayout::init_dev_mode(LPCTSTR dev_name, DEVMODE* dev_mode, DisplayMo
         dev_mode->dmPosition.y = mode->_pos_y;
         dev_mode->dmFields |= DM_POSITION;
     }
+
+    // update current DisplayMode (so mouse scaling works properly)
+    mode->_width = dev_mode->dmPelsWidth;
+    mode->_height = dev_mode->dmPelsHeight;
+
     return true;
 }
 
-- 
1.7.10.1



More information about the Spice-devel mailing list