From c5ebb61b6f6dc0388b7a0b4167578299fac1d0d0 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Tue, 19 Oct 2010 21:10:02 +0200 Subject: GtkApplication: add gtk_application_get_windows() Return a GList of the GtkWindow objects for each window that has the application set as its "application" property. --- gtk/gtkwindow.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gtk/gtkwindow.c') diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 6b8f66719b..00b4aaa397 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -2646,10 +2646,14 @@ gtk_window_release_application (GtkWindow *window) { if (window->priv->application) { - g_application_release (G_APPLICATION (window->priv->application)); - g_object_unref (window->priv->application); + GtkApplication *application; + /* steal reference into temp variable */ + application = window->priv->application; window->priv->application = NULL; + + gtk_application_remove_window (application, window); + g_object_unref (application); } } @@ -2679,8 +2683,9 @@ gtk_window_set_application (GtkWindow *window, if (window->priv->application != NULL) { - g_application_hold (G_APPLICATION (window->priv->application)); g_object_ref (window->priv->application); + + gtk_application_add_window (window->priv->application, window); } g_object_notify (G_OBJECT (window), "application"); -- cgit v1.2.1