[evolution-data-server] G_PRIORITY_HIGH_IDLE is sufficient to beat GTK+ redraws.



commit 820dcf6cfc43265c6376f15d983381c3087a5d20
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Feb 8 14:08:00 2013 -0500

    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.

 calendar/libecal/e-cal.c   |    6 ++++--
 camel/camel-folder.c       |   14 ++++++--------
 camel/camel-imapx-server.c |    6 ++++--
 camel/camel-service.c      |    5 ++---
 camel/camel-session.c      |    5 ++---
 camel/camel-store.c        |   28 ++++++++++++----------------
 camel/camel-subscribable.c |   14 ++++++--------
 7 files changed, 36 insertions(+), 42 deletions(-)
---
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index aeb7823..cec19e3 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -726,8 +726,10 @@ async_report_idle (ECal *ecal,
 	data->ecal = g_object_ref (ecal);
 	data->error = error;
 
-	/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
-	g_idle_add_full (G_PRIORITY_DEFAULT, idle_async_error_reply_cb, data, NULL);
+	/* Prioritize ahead of GTK+ redraws. */
+	g_idle_add_full (
+		G_PRIORITY_HIGH_IDLE,
+		idle_async_error_reply_cb, data, NULL);
 }
 
 /**
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 9bf9d14..79ebdbc 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -2887,7 +2887,7 @@ camel_folder_search_free (CamelFolder *folder,
  * Marks @folder as deleted and performs any required cleanup.
  *
  * This also emits the #CamelFolder::deleted signal from an idle source on
- * the main loop.  The idle source's priority is #G_PRIORITY_DEFAULT.
+ * the main loop.  The idle source's priority is #G_PRIORITY_HIGH_IDLE.
  **/
 void
 camel_folder_delete (CamelFolder *folder)
@@ -2927,10 +2927,9 @@ camel_folder_delete (CamelFolder *folder)
 	signal_data = g_slice_new0 (SignalData);
 	signal_data->folder = g_object_ref (folder);
 
-	/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE),
-	   same as GAsyncResult, where this operation is quite similar to it anyway */
+	/* Prioritize ahead of GTK+ redraws. */
 	camel_session_idle_add (
-		session, G_PRIORITY_DEFAULT,
+		session, G_PRIORITY_HIGH_IDLE,
 		folder_emit_deleted_cb,
 		signal_data, (GDestroyNotify) signal_data_free);
 }
@@ -2943,7 +2942,7 @@ camel_folder_delete (CamelFolder *folder)
  * Marks @folder as renamed.
  *
  * This also emits the #CamelFolder::renamed signal from an idle source on
- * the main loop.  The idle source's priority is #G_PRIORITY_DEFAULT.
+ * the main loop.  The idle source's priority is #G_PRIORITY_HIGH_IDLE.
  *
  * NOTE: This is an internal function used by camel stores, no locking
  * is performed on the folder.
@@ -2979,10 +2978,9 @@ camel_folder_rename (CamelFolder *folder,
 	signal_data->folder = g_object_ref (folder);
 	signal_data->folder_name = old_name;  /* transfer ownership */
 
-	/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE),
-	   same as GAsyncResult, where this operation is quite similar to it anyway */
+	/* Prioritize ahead of GTK+ redraws. */
 	camel_session_idle_add (
-		session, G_PRIORITY_DEFAULT,
+		session, G_PRIORITY_HIGH_IDLE,
 		folder_emit_renamed_cb,
 		signal_data, (GDestroyNotify) signal_data_free);
 }
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index 49266b6..86f2b71 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -6903,8 +6903,10 @@ imapx_server_dispose (GObject *object)
 
 	if (server->parser_thread) {
 		if (server->parser_thread == g_thread_self ())
-			/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE) */
-			g_idle_add_full (G_PRIORITY_HIGH, &join_helper, server->parser_thread, NULL);
+			/* Prioritize ahead of GTK+ redraws. */
+			g_idle_add_full (
+				G_PRIORITY_HIGH_IDLE,
+				&join_helper, server->parser_thread, NULL);
 		else
 			g_thread_join (server->parser_thread);
 		server->parser_thread = NULL;
diff --git a/camel/camel-service.c b/camel/camel-service.c
index b7f0ee7..17f7410 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -408,10 +408,9 @@ service_queue_notify_connection_status (CamelService *service)
 
 	session = camel_service_get_session (service);
 
-	/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE),
-	   same as GAsyncResult, where this operation is quite similar to it anyway */
+	/* Prioritize ahead of GTK+ redraws. */
 	camel_session_idle_add (
-		session, G_PRIORITY_DEFAULT,
+		session, G_PRIORITY_HIGH_IDLE,
 		service_notify_connection_status_cb,
 		g_object_ref (service),
 		(GDestroyNotify) g_object_unref);
diff --git a/camel/camel-session.c b/camel/camel-session.c
index 544fd9b..975d707 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -53,9 +53,8 @@
 	(G_TYPE_INSTANCE_GET_PRIVATE \
 	((obj), CAMEL_TYPE_SESSION, CamelSessionPrivate))
 
-/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE),
-   same as GAsyncResult, where this operation is quite similar to it anyway */
-#define JOB_PRIORITY G_PRIORITY_DEFAULT
+/* Prioritize ahead of GTK+ redraws. */
+#define JOB_PRIORITY G_PRIORITY_HIGH_IDLE
 
 #define d(x)
 
diff --git a/camel/camel-store.c b/camel/camel-store.c
index e4947fd..dab6b17 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -1257,7 +1257,7 @@ G_DEFINE_QUARK (camel-store-error-quark, camel_store_error)
  * @folder_info: information about the created folder
  *
  * Emits the #CamelStore::folder-created signal from an idle source on
- * the main loop.  The idle source's priority is #G_PRIORITY_DEFAULT.
+ * the main loop.  The idle source's priority is #G_PRIORITY_HIGH_IDLE.
  *
  * This function is only intended for Camel providers.
  *
@@ -1279,10 +1279,9 @@ camel_store_folder_created (CamelStore *store,
 	signal_data->store = g_object_ref (store);
 	signal_data->folder_info = camel_folder_info_clone (folder_info);
 
-	/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE),
-	   same as GAsyncResult, where this operation is quite similar to it anyway */
+	/* Prioritize ahead of GTK+ redraws. */
 	camel_session_idle_add (
-		session, G_PRIORITY_DEFAULT,
+		session, G_PRIORITY_HIGH_IDLE,
 		store_emit_folder_created_cb,
 		signal_data, (GDestroyNotify) signal_data_free);
 }
@@ -1293,7 +1292,7 @@ camel_store_folder_created (CamelStore *store,
  * @folder_info: information about the deleted folder
  *
  * Emits the #CamelStore::folder-deleted signal from an idle source on
- * the main loop.  The idle source's priority is #G_PRIORITY_DEFAULT.
+ * the main loop.  The idle source's priority is #G_PRIORITY_HIGH_IDLE.
  *
  * This function is only intended for Camel providers.
  *
@@ -1315,10 +1314,9 @@ camel_store_folder_deleted (CamelStore *store,
 	signal_data->store = g_object_ref (store);
 	signal_data->folder_info = camel_folder_info_clone (folder_info);
 
-	/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE),
-	   same as GAsyncResult, where this operation is quite similar to it anyway */
+	/* Prioritize ahead of GTK+ redraws. */
 	camel_session_idle_add (
-		session, G_PRIORITY_DEFAULT,
+		session, G_PRIORITY_HIGH_IDLE,
 		store_emit_folder_deleted_cb,
 		signal_data, (GDestroyNotify) signal_data_free);
 }
@@ -1329,7 +1327,7 @@ camel_store_folder_deleted (CamelStore *store,
  * @folder: the #CamelFolder that was opened
  *
  * Emits the #CamelStore::folder-opened signal from an idle source on
- * the main loop.  The idle source's priority is #G_PRIORITY_DEFAULT.
+ * the main loop.  The idle source's priority is #G_PRIORITY_HIGH_IDLE.
  *
  * This function is only intended for Camel providers.
  *
@@ -1351,10 +1349,9 @@ camel_store_folder_opened (CamelStore *store,
 	signal_data->store = g_object_ref (store);
 	signal_data->folder = g_object_ref (folder);
 
-	/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE),
-	   same as GAsyncResult, where this operation is quite similar to it anyway */
+	/* Prioritize ahead of GTK+ redraws. */
 	camel_session_idle_add (
-		session, G_PRIORITY_DEFAULT,
+		session, G_PRIORITY_HIGH_IDLE,
 		store_emit_folder_opened_cb,
 		signal_data, (GDestroyNotify) signal_data_free);
 }
@@ -1366,7 +1363,7 @@ camel_store_folder_opened (CamelStore *store,
  * @folder_info: information about the renamed folder
  *
  * Emits the #CamelStore::folder-renamed signal from an idle source on
- * the main loop.  The idle source's priority is #G_PRIORITY_DEFAULT.
+ * the main loop.  The idle source's priority is #G_PRIORITY_HIGH_IDLE.
  *
  * This function is only intended for Camel providers.
  *
@@ -1391,10 +1388,9 @@ camel_store_folder_renamed (CamelStore *store,
 	signal_data->folder_info = camel_folder_info_clone (folder_info);
 	signal_data->folder_name = g_strdup (old_name);
 
-	/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE),
-	   same as GAsyncResult, where this operation is quite similar to it anyway */
+	/* Prioritize ahead of GTK+ redraws. */
 	camel_session_idle_add (
-		session, G_PRIORITY_DEFAULT,
+		session, G_PRIORITY_HIGH_IDLE,
 		store_emit_folder_renamed_cb,
 		signal_data, (GDestroyNotify) signal_data_free);
 }
diff --git a/camel/camel-subscribable.c b/camel/camel-subscribable.c
index 470a4e0..ef14132 100644
--- a/camel/camel-subscribable.c
+++ b/camel/camel-subscribable.c
@@ -611,7 +611,7 @@ camel_subscribable_unsubscribe_folder_finish (CamelSubscribable *subscribable,
  * @folder_info: information about the subscribed folder
  *
  * Emits the #CamelSubscribable::folder-subscribed signal from an idle source
- * on the main loop.  The idle source's priority is #G_PRIORITY_DEFAULT.
+ * on the main loop.  The idle source's priority is #G_PRIORITY_HIGH_IDLE.
  *
  * This function is only intended for Camel providers.
  *
@@ -635,10 +635,9 @@ camel_subscribable_folder_subscribed (CamelSubscribable *subscribable,
 	signal_data->subscribable = g_object_ref (subscribable);
 	signal_data->folder_info = camel_folder_info_clone (folder_info);
 
-	/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE),
-	   same as GAsyncResult, where this operation is quite similar to it anyway */
+	/* Prioritize ahead of GTK+ redraws. */
 	camel_session_idle_add (
-		session, G_PRIORITY_DEFAULT,
+		session, G_PRIORITY_HIGH_IDLE,
 		subscribable_emit_folder_subscribed_cb,
 		signal_data, (GDestroyNotify) signal_data_free);
 }
@@ -649,7 +648,7 @@ camel_subscribable_folder_subscribed (CamelSubscribable *subscribable,
  * @folder_info: information about the unsubscribed folder
  *
  * Emits the #CamelSubscribable::folder-unsubscribed signal from an idle source
- * on the main loop.  The idle source's priority is #G_PRIORITY_DEFAULT.
+ * on the main loop.  The idle source's priority is #G_PRIORITY_HIGH_IDLE.
  *
  * This function is only intended for Camel providers.
  *
@@ -673,10 +672,9 @@ camel_subscribable_folder_unsubscribed (CamelSubscribable *subscribable,
 	signal_data->subscribable = g_object_ref (subscribable);
 	signal_data->folder_info = camel_folder_info_clone (folder_info);
 
-	/* schedule with priority higher than gtk+ uses for animations (check docs for G_PRIORITY_HIGH_IDLE),
-	   same as GAsyncResult, where this operation is quite similar to it anyway */
+	/* Prioritize ahead of GTK+ redraws. */
 	camel_session_idle_add (
-		session, G_PRIORITY_DEFAULT,
+		session, G_PRIORITY_HIGH_IDLE,
 		subscribable_emit_folder_unsubscribed_cb,
 		signal_data, (GDestroyNotify) signal_data_free);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]