summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2010-10-19 21:10:02 +0200
committerRyan Lortie <desrt@desrt.ca>2010-10-19 21:10:02 +0200
commitc5ebb61b6f6dc0388b7a0b4167578299fac1d0d0 (patch)
tree2453cbc89be80a412d5c0b5a4f078150e6325b7a /gtk/gtkwindow.c
parent9b3ee686eac7b53e9b14f368cb46dc773864ae37 (diff)
downloadgtk+-c5ebb61b6f6dc0388b7a0b4167578299fac1d0d0.tar.gz
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.
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c11
1 files changed, 8 insertions, 3 deletions
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");