chiark / gitweb /
Make the properties window's progress window a transient of the right
authorRichard Kettlewell <rjk@greenend.org.uk>
Wed, 25 Nov 2009 16:27:14 +0000 (16:27 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Wed, 25 Nov 2009 16:27:14 +0000 (16:27 +0000)
parent window, to avoid bizarre window reordering effects.

disobedience/choose-menu.c
disobedience/disobedience.h
disobedience/progress.c
disobedience/properties.c
disobedience/queue-menu.c

index f1aa3b0..44ad04f 100644 (file)
@@ -121,7 +121,7 @@ static void choose_properties_activate(GtkMenuItem attribute((unused)) *item,
   gtk_tree_selection_selected_foreach(choose_selection,
                                       choose_gather_selected_files_callback,
                                       v);
-  properties(v->nvec, (const char **)v->vec);
+  properties(v->nvec, (const char **)v->vec, toplevel);
 }
 
 /** @brief Set sensitivity for select children
index 29a278e..001a0b0 100644 (file)
@@ -119,7 +119,8 @@ void popup_protocol_error(int code,
                           const char *msg);
 /* Report an error */
 
-void properties(int ntracks, const char **tracks);
+void properties(int ntracks, const char **tracks,
+                GtkWidget *parent);
 /* Pop up a properties window for a list of tracks */
 
 GtkWidget *scroll_widget(GtkWidget *child);
@@ -136,7 +137,8 @@ void popup_submsg(GtkWidget *parent, GtkMessageType mt, const char *msg);
 
 void fpopup_msg(GtkMessageType mt, const char *fmt, ...);
 
-struct progress_window *progress_window_new(const char *title);
+struct progress_window *progress_window_new(const char *title,
+                                            GtkWidget *parent);
 /* Pop up a progress window */
 
 void progress_window_progress(struct progress_window *pw,
index 2e31603..33dbfc9 100644 (file)
@@ -30,12 +30,14 @@ struct progress_window {
 };
 
 /** @brief Create a progress window */
-struct progress_window *progress_window_new(const char *title) {
+struct progress_window *progress_window_new(const char *title,
+                                            GtkWidget *parent) {
   struct progress_window *pw = xmalloc(sizeof *pw);
 
   pw->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-  gtk_window_set_transient_for(GTK_WINDOW(pw->window),
-                               GTK_WINDOW(toplevel));
+  if(parent)
+    gtk_window_set_transient_for(GTK_WINDOW(pw->window),
+                                 GTK_WINDOW(parent));
   g_signal_connect(pw->window, "destroy",
                   G_CALLBACK(gtk_widget_destroyed), &pw->window);
   gtk_window_set_default_size(GTK_WINDOW(pw->window), 360, -1);
index 62ea22f..092e8db 100644 (file)
@@ -186,7 +186,8 @@ static gboolean properties_keypress(GtkWidget attribute((unused)) *widget,
   }
 }
 
-void properties(int ntracks, const char **tracks) {
+void properties(int ntracks, const char **tracks,
+                GtkWidget *parent) {
   int n, m;
   struct prefdata *f;
   GtkWidget *buttonbox, *vbox, *label, *entry, *propagate;
@@ -299,7 +300,9 @@ void properties(int ntracks, const char **tracks) {
   if(pw)
     progress_window_progress(pw, 0, 0);
   /* Pop up a progress bar while we're waiting */
-  pw = progress_window_new("Fetching Track Properties");
+  while(parent->parent)
+    parent = parent->parent;
+  pw = progress_window_new("Fetching Track Properties", parent);
 }
 
 /* Everything is filled in now */
index beb40f5..ebf8555 100644 (file)
@@ -71,7 +71,7 @@ void ql_properties_activate(GtkMenuItem attribute((unused)) *menuitem,
     gtk_tree_model_iter_next(GTK_TREE_MODEL(ql->store), iter);
   }
   if(v->nvec)
-    properties(v->nvec, (const char **)v->vec);
+    properties(v->nvec, (const char **)v->vec, ql->view);
 }
 
 /* Scratch */