Patch for #86469



EOG spews a million warnings when you do File/Exit and sometimes
crashes.  It's a simple fix.

I already put this in HEAD and in sun-patches, but I'd like to put it in
the (stable) gnome-2-0 branch.  Is it OK to commit?

ChangeLog:

	* shell/eog-window.c (eog_window_close_all): New function.
	(verb_FileExit_cb): Use eog_window_close_all(); this function 	was
fantastically buggy.
	* shell/main.c (client_die_cb): Use eog_window_close_all().

  Federico

Index: shell/eog-window.c
===================================================================
RCS file: /cvs/gnome/eog/shell/eog-window.c,v
retrieving revision 1.62
diff -u -r1.62 eog-window.c
--- shell/eog-window.c	21 Jun 2002 19:49:05 -0000	1.62
+++ shell/eog-window.c	25 Jun 2002 23:00:59 -0000
@@ -202,18 +202,7 @@
 static void
 verb_FileExit_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
 {
-	GList *l;
-	EogWindow *w;
-
-	/* Destroy windows and exit */
-	for (l = window_list; l != NULL; l = l->next) {
-		w = EOG_WINDOW (l->data);
-		gtk_widget_destroy (GTK_WIDGET (w));
-	}
-	g_list_free (window_list);
-	window_list = NULL;
-
-	bonobo_main_quit ();
+	eog_window_close_all ();
 }
 
 static void
@@ -1080,8 +1069,6 @@
 	gint32 image_width, image_height;
 	int sw, sh;
 	Bonobo_Zoomable zi;
-	double zoom_x;
-	double zoom_y;
 	gboolean need_zoom;
 	int req_width, req_height;
 	int xthick, ythick;
@@ -1362,4 +1349,25 @@
 
 	priv = eog_window->priv;
 	return priv->uri;
+}
+
+/**
+ * eog_window_close_all:
+ * 
+ * Closes all EOG windows, causing the program to exit.
+ **/
+void
+eog_window_close_all (void)
+{
+	while (1) {
+		GList *l;
+		EogWindow *window;
+
+		l = window_list;
+		if (!l)
+			break;
+
+		window = EOG_WINDOW (l->data);
+		eog_window_close (window);
+	}
 }
Index: shell/eog-window.h
===================================================================
RCS file: /cvs/gnome/eog/shell/eog-window.h,v
retrieving revision 1.10
diff -u -r1.10 eog-window.h
--- shell/eog-window.h	11 Apr 2002 17:21:16 -0000	1.10
+++ shell/eog-window.h	25 Jun 2002 23:01:00 -0000
@@ -73,6 +73,8 @@
 
 GList *eog_get_window_list (void);
 
+void eog_window_close_all (void);
+
 G_END_DECLS
 
 #endif
Index: shell/main.c
===================================================================
RCS file: /cvs/gnome/eog/shell/main.c,v
retrieving revision 1.22
diff -u -r1.22 main.c
--- shell/main.c	17 Jun 2002 23:31:36 -0000	1.22
+++ shell/main.c	25 Jun 2002 23:01:00 -0000
@@ -428,17 +428,7 @@
 static void
 client_die_cb (GnomeClient *client, gpointer data)
 {
-	while (1) {
-		GList *l;
-		EogWindow *window;
-
-		l = eog_get_window_list ();
-		if (!l)
-			break;
-
-		window = EOG_WINDOW (l->data);
-		eog_window_close (window);
-	}
+	eog_window_close_all ();
 }
 
 int


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