[gnome-photos] selection-toolbar: Use the PhotosApplication to retrieve the toplevel



commit 27a2bf40e38e34ab8e5eeab97dec3e9bfaedba84
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Nov 19 21:08:54 2012 +0100

    selection-toolbar: Use the PhotosApplication to retrieve the toplevel
    
    No functional change. This is what gnome-documents does so lets do the
    same thing.
    
    Also, Mutter is not attaching the modal for some reason. Doing the
    exact same thing as gnome-documents would help debug this later.

 src/photos-selection-toolbar.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-selection-toolbar.c b/src/photos-selection-toolbar.c
index 85fd61f..39efa66 100644
--- a/src/photos-selection-toolbar.c
+++ b/src/photos-selection-toolbar.c
@@ -30,6 +30,7 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
+#include "photos-application.h"
 #include "photos-base-item.h"
 #include "photos-item-manager.h"
 #include "photos-organize-collection-dialog.h"
@@ -227,17 +228,24 @@ photos_selection_toolbar_properties_clicked (GtkButton *button, gpointer user_da
 {
   PhotosSelectionToolbar *self = PHOTOS_SELECTION_TOOLBAR (user_data);
   PhotosSelectionToolbarPrivate *priv = self->priv;
+  PhotosApplication *app;
   GList *selection;
+  GList *windows;
   GtkWidget *dialog;
   GtkWidget *toplevel;
   const gchar *urn;
 
+  app = photos_application_new ();
+  windows = gtk_application_get_windows (GTK_APPLICATION (app));
+
   selection = photos_selection_controller_get_selection (priv->sel_cntrlr);
   urn = (gchar *) selection->data;
-  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
-  dialog = photos_properties_dialog_new (GTK_WINDOW (toplevel), urn);
+
+  dialog = photos_properties_dialog_new (GTK_WINDOW (windows->data), urn);
   photos_selection_toolbar_fade_out (self);
 
+  g_object_unref (app);
+
   g_signal_connect (dialog, "response", G_CALLBACK (photos_selection_toolbar_properties_response), self);
 }
 



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