Don't display blue "Connecting..." bar immediately

This commit is contained in:
Keith Winstein
2012-03-21 19:21:02 -04:00
parent 00561a95d3
commit 0b0ff72f40
2 changed files with 13 additions and 2 deletions
+11 -2
View File
@@ -293,7 +293,14 @@ void STMClient::main( void )
try {
output_new_frame();
int active_fds = poll( pollfds, 3, min( network->wait_time(), overlays.wait_time() ) );
int wait_time = min( network->wait_time(), overlays.wait_time() );
/* Handle startup "Connecting..." message */
if ( still_connecting() ) {
wait_time = min( 250, wait_time );
}
int active_fds = poll( pollfds, 3, wait_time );
if ( active_fds < 0 && errno == EINTR ) {
continue;
} else if ( active_fds < 0 ) {
@@ -369,7 +376,9 @@ void STMClient::main( void )
}
static const wstring connecting_notification( L"Connecting..." );
if ( (network->get_remote_state_num() == 0) && (!network->shutdown_in_progress()) ) {
if ( still_connecting()
&& (!network->shutdown_in_progress())
&& (timestamp() - network->get_latest_remote_state().timestamp > 250) ) {
overlays.get_notification_engine().set_notification_string( connecting_notification );
} else if ( (network->get_remote_state_num() != 0)
&& (overlays.get_notification_engine().get_notification_string()