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.
This commit is contained in:
Hans de Goede 2010-10-16 20:53:21 +02:00
parent 4d0e6e525c
commit 607d58f4eb

View File

@ -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)