aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-02-09 03:21:42 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-02-09 03:32:41 +0800
commit51419ff0d41e034dcd59ab860184f5e4ba752708 (patch)
treebe269a21804db7b4900c552b6eb338b69e450921
parentc364610d5f3939d5ee263615a94626602a35a9ae (diff)
downloadgsoc2013-evolution-51419ff0d41e034dcd59ab860184f5e4ba752708.tar.gz
gsoc2013-evolution-51419ff0d41e034dcd59ab860184f5e4ba752708.tar.zst
gsoc2013-evolution-51419ff0d41e034dcd59ab860184f5e4ba752708.zip
G_PRIORITY_HIGH_IDLE is sufficient to beat GTK+ redraws.
GTK+ uses (G_PRIORITY_HIGH_IDLE + 20) for redrawing operations, which is actually a slightly lower priority than G_PRIORITY_HIGH_IDLE. Therefore for our purpose, G_PRIORITY_HIGH_IDLE is sufficient. (cherry picked from commit 60d1c3054aa60d02c763538d6b1f16d9d6ab6ade)
-rw-r--r--em-format/e-mail-parser.c5
-rw-r--r--libemail-engine/e-mail-utils.c6
-rw-r--r--libemail-engine/mail-folder-cache.c5
-rw-r--r--libemail-utils/mail-mt.c18
-rw-r--r--mail/e-mail-browser.c6
-rw-r--r--mail/e-mail-display.c9
-rw-r--r--mail/e-mail-ui-session.c4
-rw-r--r--modules/itip-formatter/itip-view.c6
-rw-r--r--modules/mail/e-mail-config-reader.c7
-rw-r--r--plugins/mail-to-task/mail-to-task.c6
-rw-r--r--shell/e-shell-searchbar.c8
11 files changed, 50 insertions, 30 deletions
diff --git a/em-format/e-mail-parser.c b/em-format/e-mail-parser.c
index 213e324ef7..0a44798561 100644
--- a/em-format/e-mail-parser.c
+++ b/em-format/e-mail-parser.c
@@ -660,8 +660,9 @@ e_mail_parser_wrap_as_attachment (EMailParser *parser,
}
/* e_attachment_load_async must be called from main thread */
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- g_idle_add_full (G_PRIORITY_HIGH,
+ /* Prioritize ahead of GTK+ redraws. */
+ g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
(GSourceFunc) load_attachment_idle,
g_object_ref (empa->attachment),
NULL);
diff --git a/libemail-engine/e-mail-utils.c b/libemail-engine/e-mail-utils.c
index 72a7473bc8..52c5fb3a27 100644
--- a/libemail-engine/e-mail-utils.c
+++ b/libemail-engine/e-mail-utils.c
@@ -883,8 +883,10 @@ free_mail_cache_thread (gpointer user_data)
G_UNLOCK (photos_cache);
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- g_idle_add_full (G_PRIORITY_HIGH, free_mail_cache_idle, user_data, NULL);
+ /* Prioritize ahead of GTK+ redraws. */
+ g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
+ free_mail_cache_idle, user_data, NULL);
return NULL;
}
diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c
index 5a02340e7b..e6356cbf2d 100644
--- a/libemail-engine/mail-folder-cache.c
+++ b/libemail-engine/mail-folder-cache.c
@@ -304,8 +304,9 @@ flush_updates (MailFolderCache *cache)
if (g_queue_is_empty (&cache->priv->updates))
return;
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- cache->priv->update_id = g_idle_add_full (G_PRIORITY_DEFAULT,
+ /* Prioritize ahead of GTK+ redraws. */
+ cache->priv->update_id = g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
(GSourceFunc) flush_updates_idle_cb, cache, NULL);
}
diff --git a/libemail-utils/mail-mt.c b/libemail-utils/mail-mt.c
index 38e4d7ce77..9e7d9d6e3b 100644
--- a/libemail-utils/mail-mt.c
+++ b/libemail-utils/mail-mt.c
@@ -215,9 +215,11 @@ mail_msg_unref (gpointer msg)
g_mutex_unlock (mail_msg_lock);
/* Destroy the message from an idle callback
- * so we know we're in the main loop thread. */
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc) mail_msg_free, mail_msg, NULL);
+ * so we know we're in the main loop thread.
+ * Prioritize ahead of GTK+ redraws. */
+ g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
+ (GSourceFunc) mail_msg_free, mail_msg, NULL);
}
}
@@ -430,8 +432,9 @@ mail_msg_proxy (MailMsg *msg)
G_LOCK (idle_source_id);
if (idle_source_id == 0)
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- idle_source_id = g_idle_add_full (G_PRIORITY_DEFAULT,
+ /* Prioritize ahead of GTK+ redraws. */
+ idle_source_id = g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
(GSourceFunc) mail_msg_idle_cb, NULL, NULL);
G_UNLOCK (idle_source_id);
}
@@ -486,8 +489,9 @@ mail_msg_main_loop_push (gpointer msg)
G_LOCK (idle_source_id);
if (idle_source_id == 0)
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- idle_source_id = g_idle_add_full (G_PRIORITY_DEFAULT,
+ /* Prioritize ahead of GTK+ redraws. */
+ idle_source_id = g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
(GSourceFunc) mail_msg_idle_cb, NULL, NULL);
G_UNLOCK (idle_source_id);
}
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c
index 985beacb34..3e82aca71c 100644
--- a/mail/e-mail-browser.c
+++ b/mail/e-mail-browser.c
@@ -306,8 +306,10 @@ mail_browser_message_list_built_cb (EMailBrowser *browser,
g_return_if_fail (IS_MESSAGE_LIST (message_list));
if (!message_list_count (message_list))
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- g_idle_add_full (G_PRIORITY_DEFAULT, close_on_idle_cb, browser, NULL);
+ /* Prioritize ahead of GTK+ redraws. */
+ g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
+ close_on_idle_cb, browser, NULL);
}
static gboolean
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index 9043a45ba3..5594439313 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -1921,10 +1921,11 @@ e_mail_display_reload (EMailDisplay *display)
if (display->priv->scheduled_reload > 0)
return;
- /* Schedule reloading if neccessary */
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- display->priv->scheduled_reload =
- g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc) do_reload_display, display, NULL);
+ /* Schedule reloading if neccessary.
+ * Prioritize ahead of GTK+ redraws. */
+ display->priv->scheduled_reload = g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
+ (GSourceFunc) do_reload_display, display, NULL);
}
GtkAction *
diff --git a/mail/e-mail-ui-session.c b/mail/e-mail-ui-session.c
index 2e4ded6148..d608b22d5f 100644
--- a/mail/e-mail-ui-session.c
+++ b/mail/e-mail-ui-session.c
@@ -598,9 +598,9 @@ mail_ui_session_add_service (CamelSession *session,
context->session = g_object_ref (session);
context->service = g_object_ref (service);
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
+ /* Prioritize ahead of GTK+ redraws. */
g_idle_add_full (
- G_PRIORITY_DEFAULT,
+ G_PRIORITY_HIGH_IDLE,
(GSourceFunc) mail_ui_session_add_service_cb,
context, (GDestroyNotify) source_context_free);
}
diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c
index 520ea7b5a1..668b71851d 100644
--- a/modules/itip-formatter/itip-view.c
+++ b/modules/itip-formatter/itip-view.c
@@ -5723,8 +5723,10 @@ view_response_cb (ItipView *view,
send_item (pitip, view);
break;
case ITIP_VIEW_RESPONSE_OPEN:
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- g_idle_add_full (G_PRIORITY_DEFAULT, idle_open_cb, pitip, NULL);
+ /* Prioritize ahead of GTK+ redraws. */
+ g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
+ idle_open_cb, pitip, NULL);
return;
default:
break;
diff --git a/modules/mail/e-mail-config-reader.c b/modules/mail/e-mail-config-reader.c
index aacfbd956b..3bbf766d02 100644
--- a/modules/mail/e-mail-config-reader.c
+++ b/modules/mail/e-mail-config-reader.c
@@ -84,10 +84,11 @@ static void
mail_config_reader_constructed (GObject *object)
{
/* Bind properties to settings from an idle callback so the
- * EMailReader interface has a chance to be initialized first. */
+ * EMailReader interface has a chance to be initialized first.
+ * Prioritize ahead of GTK+ redraws. */
g_idle_add_full (
- G_PRIORITY_DEFAULT_IDLE,
- (GSourceFunc) mail_config_reader_idle_cb,
+ G_PRIORITY_HIGH_IDLE,
+ (GSourceFunc) settings_mail_reader_idle_cb,
g_object_ref (object),
(GDestroyNotify) g_object_unref);
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index 6986468591..add76e92ac 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -1014,8 +1014,10 @@ do_mail_to_event (AsyncData *data)
if (!e_cal_client_get_object_sync (client, icalcomponent_get_uid (icalcomp), NULL, &(mc->stored_comp), NULL, NULL))
mc->stored_comp = NULL;
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc) do_manage_comp_idle, mc, NULL);
+ /* Prioritize ahead of GTK+ redraws. */
+ g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
+ (GSourceFunc) do_manage_comp_idle, mc, NULL);
oldmc = mc;
diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c
index 4dd8b4806f..07a38f0de7 100644
--- a/shell/e-shell-searchbar.c
+++ b/shell/e-shell-searchbar.c
@@ -1544,10 +1544,14 @@ e_shell_searchbar_load_state (EShellSearchbar *searchbar)
gtk_action_unblock_activate (action);
/* Execute the search when we have time. */
+
g_object_ref (shell_view);
searchbar->priv->state_dirty = FALSE;
- /* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
- g_idle_add_full (G_PRIORITY_DEFAULT, idle_execute_search, shell_view, NULL);
+
+ /* Prioritize ahead of GTK+ redraws. */
+ g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE,
+ idle_execute_search, shell_view, NULL);
}
void