From be68c08f257b3b84110985e4f93e3d311bcb40e1 Mon Sep 17 00:00:00 2001 From: short <> Date: Sat, 13 Dec 2003 15:16:31 +0000 Subject: [PATCH] Disks scanning performance: GTK+ mode: Prevent expensive polling gdk_flush()es. --- src/install/acquire/ui-gnome.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/install/acquire/ui-gnome.c b/src/install/acquire/ui-gnome.c index 344177e..e0d6ec0 100644 --- a/src/install/acquire/ui-gnome.c +++ b/src/install/acquire/ui-gnome.c @@ -250,6 +250,8 @@ struct timeval diff_timeval; static gboolean ui_gnome_progress(GnomeVFSURI *uri) { +gboolean want_gdk_flush=FALSE; + /* 'uri' may be NULL */ gdk_threads_enter(); @@ -267,9 +269,11 @@ static gchar *uri_text=NULL; } if (uri_text) { - if (want_progress_update(&ProgressEntry_updated_timeval)) + if (want_progress_update(&ProgressEntry_updated_timeval)) { gtk_entry_set_text(ProgressEntry, uri_text+(strncmp(uri_text,"file://",strlen("file://")) ? 0 : strlen("file://"))); + want_gdk_flush=TRUE; + } } } @@ -280,7 +284,8 @@ static gchar *uri_text=NULL; FALSE); /* may_block */ #endif /* UI_GNOME_THREADS */ - gdk_flush(); + if (want_gdk_flush) + gdk_flush(); gdk_threads_leave(); /* Do not: g_thread_yield(); -- 1.8.3.1