diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 151fa0cabb..3bf67ca8e8 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -4822,6 +4822,7 @@ gtk_window_group_add_window gtk_window_group_get_type G_GNUC_CONST gtk_window_group_new gtk_window_group_remove_window +gtk_window_group_get_windows gtk_window_has_toplevel_focus gtk_window_iconify gtk_window_is_active diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index ffd05e8d1c..54c3a6d31d 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -7456,6 +7456,37 @@ gtk_window_group_remove_window (GtkWindowGroup *window_group, g_object_unref (window); } +/** + * gtk_window_group_get_windows: + * @window_group: a #GtkWindowGroup + * + * Returns a list of the #GtkWindows that belong to @window_group. + * + * Returns: A newly-allocated list of windows inside the group. + * + * Since: GSEAL-branch + **/ +GList * +gtk_window_group_get_windows (GtkWindowGroup *window_group) +{ + GList *toplevels, *toplevel, *group_windows; + + g_return_val_if_fail (GTK_IS_WINDOW_GROUP (window_group), NULL); + + group_windows = NULL; + toplevels = gtk_window_list_toplevels (); + + for (toplevel = toplevels; toplevel; toplevel = toplevel->next) + { + GtkWindow *window = toplevel->data; + + if (window_group == window->group) + group_windows = g_list_prepend (group_windows, window); + } + + return g_list_reverse (group_windows); +} + /** * gtk_window_get_group: * @window: a #GtkWindow, or %NULL diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 40cb937cd5..f10fb1e414 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -394,6 +394,8 @@ void gtk_window_group_add_window (GtkWindowGroup *window_grou GtkWindow *window); void gtk_window_group_remove_window (GtkWindowGroup *window_group, GtkWindow *window); +GList * gtk_window_group_get_windows (GtkWindowGroup *window_group); + /* --- internal functions --- */ void _gtk_window_internal_set_focus (GtkWindow *window,