[sound-juicer] Use g_application_mark_busy()



commit 976572e8ff01e67a6a6b40e8f98d3d3ae6ff4040
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Thu Sep 4 16:59:46 2014 +0100

    Use g_application_mark_busy()
    
    Marking the application as busy is a better option than changing the
    mouse cursor. This exposes bug 736492 in older versions of gnome-shell.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734603

 src/sj-main.c |   34 +++-------------------------------
 1 files changed, 3 insertions(+), 31 deletions(-)
---
diff --git a/src/sj-main.c b/src/sj-main.c
index 22db00c..3043d4f 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -2010,57 +2010,29 @@ is_cd_duplication_available(void)
 static void
 ui_set_retrieving_metadata (gboolean state)
 {
-  GdkWindow *window;
-
-  window = gtk_widget_get_window (main_window);
   if (state) {
-    GdkCursor *cursor;
-
     gtk_statusbar_push(GTK_STATUSBAR(status_bar), 0,
                        _("Retrieving track listing...please wait."));
-    cursor = gdk_cursor_new_for_display (gtk_widget_get_display (main_window),
-                                         GDK_WATCH);
-    gdk_window_set_cursor (window, cursor);
-    g_object_unref (cursor);
-    gdk_display_sync (gtk_widget_get_display (GTK_WIDGET (main_window)));
+    g_application_mark_busy (g_application_get_default ());
   } else {
     gtk_statusbar_pop(GTK_STATUSBAR(status_bar), 0);
-    gdk_window_set_cursor (window, NULL);
+    g_application_unmark_busy (g_application_get_default ());
   }
 }
 
 static void
-reread_main_window_realize_cb (GtkWidget *widget,
-                               gpointer   user_data)
-{
-  ui_set_retrieving_metadata (TRUE);
-}
-
-static void
 reread_state_changed_cb (gchar    *group_name,
                          gchar    *action_name,
                          GVariant *value,
                          gpointer  user_data)
 {
   static gboolean state = FALSE;
-  static gulong id = 0;
 
   if (g_variant_get_boolean (value) == state)
     return;
 
   state = !state;
-  if (id != 0) {
-    g_signal_handler_disconnect (main_window, id);
-    id = 0;
-  }
-  if (gtk_widget_get_realized (main_window)) {
-    ui_set_retrieving_metadata (state);
-  } else if (state) {
-    id = g_signal_connect (main_window,
-                           "realize",
-                           G_CALLBACK (reread_main_window_realize_cb),
-                           NULL);
-  }
+  ui_set_retrieving_metadata (state);
 }
 
 GActionEntry app_entries[] = {


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