commit b3c1a05a291709f60b9ada260049a560f18e92fa
Author: Michel Dänzer <michel@daenzer.net>
Date:   Mon May 21 12:14:33 2012 +0200

    Tune priorities for ilde callbacks.

diff --git a/em-format/em-format.c b/em-format/em-format.c
index f1cbef4..f0aa8ce 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -961,8 +961,9 @@ em_format_queue_redraw (EMFormat *emf)
 	g_return_if_fail (EM_IS_FORMAT (emf));
 
 	if (emf->priv->redraw_idle_id == 0)
-		emf->priv->redraw_idle_id = g_idle_add (
-			(GSourceFunc) format_redraw_idle_cb, emf);
+		emf->priv->redraw_idle_id = g_idle_add_full (
+			G_PRIORITY_DEFAULT,
+			(GSourceFunc) format_redraw_idle_cb, emf, NULL);
 }
 
 /**
diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c
index 956fd23..f38222c 100644
--- a/libemail-engine/mail-folder-cache.c
+++ b/libemail-engine/mail-folder-cache.c
@@ -306,8 +306,9 @@ flush_updates (MailFolderCache *cache)
 	if (g_queue_is_empty (&cache->priv->updates))
 		return;
 
-	cache->priv->update_id = g_idle_add (
-		(GSourceFunc) flush_updates_idle_cb, cache);
+	cache->priv->update_id = g_idle_add_full (
+		GDK_PRIORITY_REDRAW, (GSourceFunc) flush_updates_idle_cb, cache,
+		NULL);
 }
 
 /* This is how unread counts work (and don't work):
diff --git a/libemail-utils/mail-mt.c b/libemail-utils/mail-mt.c
index ae73ae6..9a11e50 100644
--- a/libemail-utils/mail-mt.c
+++ b/libemail-utils/mail-mt.c
@@ -379,7 +379,7 @@ mail_msg_idle_cb (void)
 		cancellable = msg->cancellable;
 
 		g_idle_add_full (
-			G_PRIORITY_DEFAULT,
+			G_PRIORITY_DEFAULT_IDLE,
 			(GSourceFunc) mail_msg_submit,
 			g_object_ref (msg->cancellable),
 			(GDestroyNotify) g_object_unref);
@@ -429,8 +429,9 @@ mail_msg_proxy (MailMsg *msg)
 
 	G_LOCK (idle_source_id);
 	if (idle_source_id == 0)
-		idle_source_id = g_idle_add (
-			(GSourceFunc) mail_msg_idle_cb, NULL);
+		idle_source_id = g_idle_add_full (
+			G_PRIORITY_HIGH_IDLE,
+			(GSourceFunc) mail_msg_idle_cb, NULL, NULL);
 	G_UNLOCK (idle_source_id);
 }
 
@@ -483,8 +484,9 @@ mail_msg_main_loop_push (gpointer msg)
 
 	G_LOCK (idle_source_id);
 	if (idle_source_id == 0)
-		idle_source_id = g_idle_add (
-			(GSourceFunc) mail_msg_idle_cb, NULL);
+		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/libgnomecanvas/gnome-canvas-rich-text.c b/libgnomecanvas/gnome-canvas-rich-text.c
index a632c69..0b6d512 100644
--- a/libgnomecanvas/gnome-canvas-rich-text.c
+++ b/libgnomecanvas/gnome-canvas-rich-text.c
@@ -1656,7 +1656,7 @@ invalidated_handler (GtkTextLayout *layout,
 
 	/* We are called from the update cycle; gotta put this in an idle
 	 * loop. */
-	g_idle_add (request_update, text);
+	g_idle_add_full (G_PRIORITY_DEFAULT, request_update, text, NULL);
 } /* invalidated_handler */
 
 static void
@@ -1713,7 +1713,7 @@ changed_handler (GtkTextLayout *layout,
 
 	/* We are called from the update cycle; gotta put this in an idle
 	 * loop. */
-	g_idle_add (request_update, text);
+	g_idle_add_full (G_PRIORITY_DEFAULT, request_update, text, NULL);
 } /* changed_handler */
 
 /**
diff --git a/mail/em-sync-stream.c b/mail/em-sync-stream.c
index 841d890..0279c35 100644
--- a/mail/em-sync-stream.c
+++ b/mail/em-sync-stream.c
@@ -115,7 +115,9 @@ sync_stream_sync_op (EMSyncStream *emss,
 
 	if (emss->idle_id)
 		g_source_remove (emss->idle_id);
-	emss->idle_id = g_idle_add ((GSourceFunc) sync_stream_process_message, &msg);
+	emss->idle_id = g_idle_add_full (
+		G_PRIORITY_DEFAULT, (GSourceFunc) sync_stream_process_message,
+		&msg, NULL);
 
 	e_flag_wait (msg.done);
 	e_flag_free (msg.done);
diff --git a/mail/message-list.c b/mail/message-list.c
index fe0106e..b82fd2b 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -4026,7 +4026,7 @@ on_cursor_activated_cmd (ETree *tree,
 
 	if (!message_list->idle_id) {
 		message_list->idle_id =
-			g_idle_add_full (G_PRIORITY_LOW, on_cursor_activated_idle,
+			g_idle_add_full (G_PRIORITY_DEFAULT, on_cursor_activated_idle,
 					 message_list, NULL);
 	}
 }
@@ -4059,7 +4059,7 @@ on_selection_changed_cmd (ETree *tree,
 		g_free (ml->cursor_uid);
 		ml->cursor_uid = g_strdup (newuid);
 		if (!ml->idle_id)
-			ml->idle_id = g_idle_add_full (G_PRIORITY_LOW, on_cursor_activated_idle, ml, NULL);
+			ml->idle_id = g_idle_add_full (G_PRIORITY_DEFAULT, on_cursor_activated_idle, ml, NULL);
 	}
 
 	ml->last_sel_single = uids->len == 1;
diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c
index ff3f06b..bb6ba8b 100644
--- a/shell/e-shell-searchbar.c
+++ b/shell/e-shell-searchbar.c
@@ -1459,7 +1459,8 @@ e_shell_searchbar_load_state (EShellSearchbar *searchbar)
 	/* Execute the search when we have time. */
 	g_object_ref (shell_view);
 	searchbar->priv->state_dirty = FALSE;
-	g_idle_add (idle_execute_search, shell_view);
+	g_idle_add_full (GDK_PRIORITY_REDRAW,
+			 idle_execute_search, shell_view, NULL);
 }
 
 void
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index 91bd7c4..9c978e9 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -747,7 +747,7 @@ add_idle (ECanvas *canvas)
 		return;
 
 	canvas->idle_id = g_idle_add_full (
-		G_PRIORITY_HIGH_IDLE, idle_handler, (gpointer) canvas, NULL);
+		G_PRIORITY_DEFAULT, idle_handler, (gpointer) canvas, NULL);
 }
 
 static void
diff --git a/widgets/misc/e-paned.c b/widgets/misc/e-paned.c
index 3b8f16b..ab1c67d 100644
--- a/widgets/misc/e-paned.c
+++ b/widgets/misc/e-paned.c
@@ -299,7 +299,7 @@ paned_size_allocate (GtkWidget *widget,
 	 * be called from size_allocate, so schedule it from an idle
 	 * callback so the change takes effect. */
 	g_idle_add_full (
-		G_PRIORITY_DEFAULT_IDLE,
+		GDK_PRIORITY_REDRAW - 5,
 		(GSourceFunc) paned_queue_resize_on_idle,
 		g_object_ref (paned),
 		(GDestroyNotify) g_object_unref);
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 7fb6bec..f6247d7 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -1101,7 +1101,7 @@ eti_idle_maybe_show_cursor (ETableItem *eti)
 	if (eti->cursor_on_screen) {
 		g_object_ref (eti);
 		if (!eti->cursor_idle_id)
-			eti->cursor_idle_id = g_idle_add (eti_idle_show_cursor_cb, eti);
+			eti->cursor_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT, eti_idle_show_cursor_cb, eti, NULL);
 	}
 }
 
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index f78a477..5d6ad7a 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -871,7 +871,7 @@ tree_canvas_reflow (GnomeCanvas *canvas,
 {
 	if (!e_tree->priv->reflow_idle_id)
 		e_tree->priv->reflow_idle_id = g_idle_add_full (
-			400, (GSourceFunc) tree_canvas_reflow_idle,
+			G_PRIORITY_DEFAULT, (GSourceFunc) tree_canvas_reflow_idle,
 			e_tree, NULL);
 }
 
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c
index dba051e..91dd24e 100644
--- a/widgets/text/e-reflow.c
+++ b/widgets/text/e-reflow.c
@@ -250,7 +250,7 @@ cursor_changed (ESelectionModel *selection,
 	}
 
 	if (reflow->do_adjustment_idle_id == 0)
-		reflow->do_adjustment_idle_id = g_idle_add (do_adjustment, reflow);
+		reflow->do_adjustment_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT, do_adjustment, reflow, NULL);
 
 }
 
