toplevel listing
- From: Havoc Pennington <hp redhat com>
- To: gtk-devel-list gnome org
- Subject: toplevel listing
- Date: 08 Mar 2001 14:43:57 -0500
Hi,
For http://bugzilla.gnome.org/show_bug.cgi?id=11821, any objections to
this patch?
Havoc
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.1793
diff -u -u -r1.1793 ChangeLog
--- ChangeLog 2001/03/08 17:13:04 1.1793
+++ ChangeLog 2001/03/08 19:38:12
@@ -1,3 +1,10 @@
+2001-03-08 Havoc Pennington <hp redhat com>
+
+ * gtk/gtkwindow.c (_gtk_window_reference_toplevels): new function
+ for internal use
+ (gtk_window_list_toplevels): don't reference list members, closes
+ #11821
+
Thu Mar 8 18:13:20 2001 Tim Janik <timj gtk org>
* gtk/testgtk.c: re-enabled event watcher emission hooks.
Index: gtk/gtkwindow.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwindow.c,v
retrieving revision 1.103
diff -u -u -r1.103 gtkwindow.c
--- gtk/gtkwindow.c 2001/03/08 06:14:43 1.103
+++ gtk/gtkwindow.c 2001/03/08 19:38:12
@@ -777,11 +777,10 @@
/**
* gtk_window_list_toplevels:
*
- * Returns a list of all existing toplevel windows. Each widget
- * in the list has a reference added to it; to free the
- * list, first unref each widget in the list, then free the list.
+ * Returns a list of all existing toplevel windows. The list must
+ * be freed with g_list_free(), but the list contents need not be unreferenced.
*
- * Return value: list of referenced toplevel widgets
+ * Return value: list of all toplevel windows
**/
GList*
gtk_window_list_toplevels (void)
@@ -790,6 +789,18 @@
GSList *slist;
for (slist = toplevel_list; slist; slist = slist->next)
+ list = g_list_prepend (list, slist->data);
+
+ return list;
+}
+
+GList*
+_gtk_window_reference_toplevels (void)
+{
+ GList *list = NULL;
+ GSList *slist;
+
+ for (slist = toplevel_list; slist; slist = slist->next)
list = g_list_prepend (list, gtk_widget_ref (slist->data));
return list;
@@ -2002,7 +2013,7 @@
_gtk_icon_set_invalidate_caches ();
- toplevels = gtk_window_list_toplevels ();
+ toplevels = _gtk_window_reference_toplevels ();
for (list = toplevels; list; list = list->next)
{
Index: gtk/gtkwindow.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwindow.h,v
retrieving revision 1.28
diff -u -u -r1.28 gtkwindow.h
--- gtk/gtkwindow.h 2001/03/07 21:10:44 1.28
+++ gtk/gtkwindow.h 2001/03/08 19:38:12
@@ -167,7 +167,7 @@
/* If window is set modal, input will be grabbed when show and released when hide */
void gtk_window_set_modal (GtkWindow *window,
gboolean modal);
-GList* gtk_window_list_toplevels (void);
+GList* gtk_window_list_toplevels (void);
/* Get the "built-in" accel group (convenience thing) */
GtkAccelGroup* gtk_window_get_default_accel_group (GtkWindow *window);
@@ -198,6 +198,7 @@
gint height,
gint *new_width,
gint *new_height);
+GList* _gtk_window_reference_toplevels (void);
#ifdef __cplusplus
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]