diff options
author | Sandy Stutsman <sstutsma@redhat.com> | 2015-08-04 19:16:34 -0400 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2015-08-06 12:01:45 +0200 |
commit | 259d6b5bdb29008e7e6f69feb1b65870f40a95c9 (patch) | |
tree | c9511ee1888908968d851ad15a53ced468963059 | |
parent | 6023630562fd129433aef1eaddcf6fbee3f03e50 (diff) |
Check for set-monitors-position capability from client.
If the client hasn't been updated to handle multi-monitor configurations
that are not multi-head, vd_agent won't issue the MONITORS_CONFIG driver
escape.
These changes will ensure that the new MONITORS_CONFIG escape in commit:
6023630562fd129433aef1eaddcf6fbee3f03e50 will not break with an older
client.
This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1248196
m--------- | spice-protocol | 0 | ||||
-rw-r--r-- | vdagent/desktop_layout.cpp | 4 | ||||
-rw-r--r-- | vdagent/desktop_layout.h | 5 | ||||
-rw-r--r-- | vdagent/vdagent.cpp | 4 |
4 files changed, 11 insertions, 2 deletions
diff --git a/spice-protocol b/spice-protocol -Subproject 5ff3fa7080bd08392fc011175657264d57dddce +Subproject 666b5c5780acf3176a9cff61ad549d30bb1b982 diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp index 7a34f7f..a7666ca 100644 --- a/vdagent/desktop_layout.cpp +++ b/vdagent/desktop_layout.cpp @@ -35,6 +35,7 @@ void DisplayMode::set_res(DWORD width, DWORD height, DWORD depth) DesktopLayout::DesktopLayout() : _total_width (0) , _total_height (0) + , _send_monitors_position(false) { MUTEX_INIT(_mutex); get_displays(); @@ -365,6 +366,9 @@ bool DesktopLayout::update_monitor_config(LPCTSTR dev_name, DisplayMode* mode) if (!mode || !mode->get_attached()) return false; + //Don't configure monitors unless the client supports it + if(!_send_monitors_position) return FALSE; + HDC hdc = CreateDC(dev_name, NULL, NULL, NULL); memset(&monitor_config, 0, sizeof(monitor_config)); diff --git a/vdagent/desktop_layout.h b/vdagent/desktop_layout.h index 0e310e3..ece3946 100644 --- a/vdagent/desktop_layout.h +++ b/vdagent/desktop_layout.h @@ -73,22 +73,23 @@ public: size_t get_display_count() { return _displays.size();} DWORD get_total_width() { return _total_width;} DWORD get_total_height() { return _total_height;} - + void set_position_configurable(bool flag) { _send_monitors_position = flag; } private: void clean_displays(); void normalize_displays_pos(); DisplayMode * get_primary_display(); + bool update_monitor_config(LPCTSTR dev_name, DisplayMode* mode); static bool consistent_displays(); static bool is_attached(LPCTSTR dev_name); static bool get_qxl_device_id(WCHAR* device_key, DWORD* device_id); static bool init_dev_mode(LPCTSTR dev_name, DEVMODE* dev_mode, DisplayMode* mode, LONG normal_x, LONG normal_y, bool set_pos); - static bool update_monitor_config(LPCTSTR dev_name, DisplayMode* mode); private: mutex_t _mutex; Displays _displays; DWORD _total_width; DWORD _total_height; + bool _send_monitors_position; }; #endif diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp index efce981..c976665 100644 --- a/vdagent/vdagent.cpp +++ b/vdagent/vdagent.cpp @@ -835,6 +835,10 @@ bool VDAgent::handle_announce_capabilities(VDAgentAnnounceCapabilities* announce _client_caps_size = caps_size; } memcpy(_client_caps, announce_capabilities->caps, sizeof(_client_caps[0]) * caps_size); + + if (VD_AGENT_HAS_CAPABILITY(_client_caps, _client_caps_size, + VD_AGENT_CAP_MONITORS_CONFIG_POSITION)) + _desktop_layout->set_position_configurable(true); if (announce_capabilities->request) { return send_announce_capabilities(false); } |