Instead of updating the splash screen every time we load or hand off
a dissector, update it every 250 ms. This drastically reduces the startup time on remote displays (for me, at least). svn path=/trunk/; revision=21796
This commit is contained in:
parent
99c98d6c6e
commit
d251c05fad
|
@ -150,6 +150,8 @@ splash_new(char *message)
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define REGISTER_FREQ 250 /* Milliseconds */
|
||||||
|
|
||||||
void
|
void
|
||||||
splash_update(register_action_e action, char *message, gpointer client_data)
|
splash_update(register_action_e action, char *message, gpointer client_data)
|
||||||
{
|
{
|
||||||
|
@ -167,10 +169,22 @@ splash_update(register_action_e action, char *message, gpointer client_data)
|
||||||
|
|
||||||
static register_action_e last_action = RA_NONE;
|
static register_action_e last_action = RA_NONE;
|
||||||
|
|
||||||
|
static GTimeVal cur_tv;
|
||||||
|
static GTimeVal next_tv = {0, 0};
|
||||||
|
|
||||||
win = (GtkWidget *)client_data;
|
win = (GtkWidget *)client_data;
|
||||||
|
|
||||||
if (win == NULL) return;
|
if (win == NULL) return;
|
||||||
|
|
||||||
|
g_get_current_time(&cur_tv);
|
||||||
|
if (cur_tv.tv_sec <= next_tv.tv_sec && cur_tv.tv_usec <= next_tv.tv_usec && ul_sofar < ul_count - 1) {
|
||||||
|
/* Only update every REGISTER_FREQ milliseconds */
|
||||||
|
ul_sofar++;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
memcpy(&next_tv, &cur_tv, sizeof(next_tv));
|
||||||
|
g_time_val_add(&next_tv, REGISTER_FREQ * 1000);
|
||||||
|
|
||||||
if(last_action != action) {
|
if(last_action != action) {
|
||||||
/* the action has changed */
|
/* the action has changed */
|
||||||
switch(action) {
|
switch(action) {
|
||||||
|
|
Loading…
Reference in New Issue