From 607d58f4eb7abeb29329f7ddc1a7aa3700bc95a3 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sat, 16 Oct 2010 20:53:21 +0200 Subject: client: Do not try to send display_config until we've received the agent caps Currenty, we check the agent caps in RedClient::handle_agent_connected for VD_AGENT_CAP_DISPLAY_CONFIG and if present send display_config, but at this time we have not received the caps yet, so remove this. Also the send_agent_display_config call in on_agent_announce_capabilities lacks a check for _agent_disp_config_sent, and we send the display config before announcing that we may do so by sending our own caps, which seems inpolite. --- client/red_client.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'client/red_client.cpp') diff --git a/client/red_client.cpp b/client/red_client.cpp index b9e1421e..0fc48157 100644 --- a/client/red_client.cpp +++ b/client/red_client.cpp @@ -1011,11 +1011,6 @@ void RedClient::handle_agent_connected(RedPeer::InMessage* message) if (_auto_display_res && !_agent_mon_config_sent) { send_agent_monitors_config(); } - - if (VD_AGENT_HAS_CAPABILITY(_agent_caps, _agent_caps_size, - VD_AGENT_CAP_DISPLAY_CONFIG) && !_agent_disp_config_sent) { - send_agent_display_config(); - } } void RedClient::handle_agent_disconnected(RedPeer::InMessage* message) @@ -1037,15 +1032,15 @@ void RedClient::on_agent_announce_capabilities( } memcpy(_agent_caps, caps->caps, sizeof(_agent_caps[0]) * caps_size); + if (caps->request) { + send_agent_announce_capabilities(false); + } if (VD_AGENT_HAS_CAPABILITY(caps->caps, caps_size, - VD_AGENT_CAP_DISPLAY_CONFIG)) { + VD_AGENT_CAP_DISPLAY_CONFIG) && !_agent_disp_config_sent) { // not sending the color depth through send_agent_monitors_config, since // it applies only for attached screens. send_agent_display_config(); } - if (caps->request) { - send_agent_announce_capabilities(false); - } } void RedClient::on_agent_reply(VDAgentReply* reply) -- cgit