G_PRIORITY_HIGH_IDLE is sufficient to beat GTK+ redraws.
authorMatthew Barnes <mbarnes@redhat.com>
Fri, 8 Feb 2013 19:08:00 +0000 (14:08 -0500)
committerMatthew Barnes <mbarnes@redhat.com>
Fri, 8 Feb 2013 19:08:00 +0000 (14:08 -0500)
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
camel/camel-folder.c
camel/camel-imapx-server.c
camel/camel-service.c
camel/camel-session.c
camel/camel-store.c
camel/camel-subscribable.c

index aeb7823..cec19e3 100644 (file)
@@ -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);
 }
 
 /**
index 9bf9d14..79ebdbc 100644 (file)
@@ -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);
 }
index 49266b6..86f2b71 100644 (file)
@@ -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;
index b7f0ee7..17f7410 100644 (file)
@@ -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);
index 544fd9b..975d707 100644 (file)
@@ -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)
 
index e4947fd..dab6b17 100644 (file)
@@ -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);
 }
index 470a4e0..ef14132 100644 (file)
@@ -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);
 }