# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: geoffrey.antos@gmail.com-20080807181524-\
#   0u5cond0cps7e9kz
# target_branch: ../upstream/
# testament_sha1: bb395f623d168ca48eb1bbe36bc580ed7dcf77c2
# timestamp: 2008-08-07 11:16:52 -0700
# source_branch: .
# base_revision_id: geoffrey.antos@gmail.com-20080731204831-\
#   mfwyro3tf009jpm7
# 
# Begin patch
=== modified file 'ChangeLog'
--- ChangeLog	2008-07-31 20:48:31 +0000
+++ ChangeLog	2008-08-07 18:15:24 +0000
@@ -1,3 +1,10 @@
+2008-08-07  Geoffrey Antos <dynamotwain@aim.com>
+	* libgthumb/image-viewer.c: (set_pixbuf__step2),
+	(create_image), (image_loaded):
+		Do not emit image_loaded signal when
+		image_viewer_set_pixbuf is called, fixing
+		prompts to save modified images.
+
 2008-07-31  Geoffrey Antos <dynamotwain@aim.com>
 	* configure.in:
 		Remove checks for XF86Gamma headers and libs.

=== modified file 'libgthumb/image-viewer.c'
--- libgthumb/image-viewer.c	2008-07-31 19:39:58 +0000
+++ libgthumb/image-viewer.c	2008-08-07 18:15:24 +0000
@@ -441,6 +441,7 @@
 }
 
 
+static void create_image   (ImageLoader *il, gpointer data);
 static void image_loaded   (ImageLoader *il, gpointer data);
 static void image_error    (ImageLoader *il, gpointer data);
 static void image_progress (ImageLoader *il, float progress, gpointer data);
@@ -1362,7 +1363,7 @@
 
 	image_loader_set_file   (priv->loader, NULL);
 	image_loader_set_pixbuf (priv->loader, pixbuf);
-	image_loaded (priv->loader, ivl_data->viewer);
+	create_image (priv->loader, ivl_data->viewer);
 
 	g_object_unref (G_OBJECT (pixbuf));
 	g_free (ivl_data);
@@ -1625,6 +1626,20 @@
 	      gpointer data)
 {
 	ImageViewer        *viewer = data;
+
+	create_image (il, data);
+
+	g_signal_emit (G_OBJECT (viewer),
+		       image_viewer_signals[IMAGE_LOADED],
+		       0);
+}
+
+
+static void
+create_image (ImageLoader *il,
+	      gpointer data)
+{
+	ImageViewer        *viewer = data;
 	ImageViewerPrivate *priv = IMAGE_VIEWER_GET_PRIVATE (viewer);
 	ImageViewerImage   *next;
 
@@ -1675,10 +1690,6 @@
 			  G_CALLBACK (zoom_changed_cb), viewer);
 
 	gtk_widget_queue_resize (GTK_WIDGET (viewer));
-
-	g_signal_emit (G_OBJECT (viewer),
-		       image_viewer_signals[IMAGE_LOADED],
-		       0);
 }
 
 

