[nautilus] NautilusWindow: don't pass the application on construction



commit e6fecc0500b83ad55a1d8b6acbcf520ab9c0eb8d
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Fri Mar 1 14:09:10 2013 +0100

    NautilusWindow: don't pass the application on construction
    
    We can guess it easily using g_application_get_default () and set it as the
    gtk application before than the GtkWindow constructor would do.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694266

 src/nautilus-application.c |    2 +-
 src/nautilus-window.c      |    8 ++++----
 src/nautilus-window.h      |    3 +--
 3 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 5df7a90..c93e349 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -525,7 +525,7 @@ nautilus_application_create_window (NautilusApplication *application,
        g_return_val_if_fail (NAUTILUS_IS_APPLICATION (application), NULL);
        nautilus_profile_start (NULL);
 
-       window = nautilus_window_new (GTK_APPLICATION (application), screen);
+       window = nautilus_window_new (screen);
 
        maximized = g_settings_get_boolean
                (nautilus_window_state, NAUTILUS_WINDOW_STATE_MAXIMIZED);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 6c67f5b..c1f6765 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1135,6 +1135,9 @@ nautilus_window_constructed (GObject *self)
 
        G_OBJECT_CLASS (nautilus_window_parent_class)->constructed (self);
 
+       application = NAUTILUS_APPLICATION (g_application_get_default ());
+       gtk_window_set_application (GTK_WINDOW (window), GTK_APPLICATION (application));
+
        /* disable automatic menubar handling, since we show our regular
         * menubar together with the app menu.
         */
@@ -1181,7 +1184,6 @@ nautilus_window_constructed (GObject *self)
                nautilus_window_hide_sidebar (window);
        }
 
-       application = NAUTILUS_APPLICATION (g_application_get_default ());
        window->details->bookmarks_id =
                g_signal_connect_swapped (nautilus_application_get_bookmarks (application), "changed",
                                          G_CALLBACK (nautilus_window_sync_bookmarks), window);
@@ -1947,11 +1949,9 @@ nautilus_window_class_init (NautilusWindowClass *class)
 }
 
 NautilusWindow *
-nautilus_window_new (GtkApplication *application,
-                    GdkScreen      *screen)
+nautilus_window_new (GdkScreen *screen)
 {
        return g_object_new (NAUTILUS_TYPE_WINDOW,
-                            "application", application,
                             "screen", screen,
                             NULL);
 }
diff --git a/src/nautilus-window.h b/src/nautilus-window.h
index 2472998..588c728 100644
--- a/src/nautilus-window.h
+++ b/src/nautilus-window.h
@@ -89,8 +89,7 @@ struct NautilusWindow {
 };
 
 GType            nautilus_window_get_type             (void);
-NautilusWindow * nautilus_window_new                  (GtkApplication    *application,
-                                                       GdkScreen         *screen);
+NautilusWindow * nautilus_window_new                  (GdkScreen         *screen);
 void             nautilus_window_close                (NautilusWindow    *window);
 
 void             nautilus_window_connect_content_view (NautilusWindow    *window,


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