[f-spot/rubenv-gsoc-2009: 58/86] Make sure preview updates happen in the correct thread.



commit b7f89fa3e044d06c585264ef61c72030cee20a1e
Author: Ruben Vermeersch <ruben savanne be>
Date:   Sat Aug 8 03:15:26 2009 +0200

    Make sure preview updates happen in the correct thread.

 src/Editors/Editor.cs |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/Editors/Editor.cs b/src/Editors/Editor.cs
index 2eda078..345a934 100644
--- a/src/Editors/Editor.cs
+++ b/src/Editors/Editor.cs
@@ -208,12 +208,15 @@ namespace FSpot.Editors {
 			}
 
 			Pixbuf previewed = ProcessFast (Preview, null);
-			State.PhotoImageView.ChangeImage (previewed, State.PhotoImageView.PixbufOrientation, false, false);
-			App.Instance.Organizer.InfoBox.UpdateHistogram (previewed);
 
-			if (old_preview != null) {
-				old_preview.Dispose ();
-			}
+			Gtk.Application.Invoke (delegate {
+					State.PhotoImageView.ChangeImage (previewed, State.PhotoImageView.PixbufOrientation, false, false);
+                    App.Instance.Organizer.InfoBox.UpdateHistogram (previewed);
+
+					if (old_preview != null) {
+						old_preview.Dispose ();
+					}
+				});
 		}
 
 		private void CalcPreviewSize (Pixbuf input, out int width, out int height) {



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