[eog-plugins] [exif-display] Don't draw on the drawing area until it has been realized



commit 7ccf82bea4bc9cc80d83ca5203083e38afb2396b
Author: Felix Riemann <friemann gnome org>
Date:   Tue Aug 25 17:50:41 2009 +0200

    [exif-display] Don't draw on the drawing area until it has been realized
    
    Avoids crashes with multiple plugins using the sidebar. Apparently there
    can be expose events before the widget is realized. Fixes bgo#593003.

 ChangeLog                                      |    6 ++++++
 plugins/exif-display/eog-exif-display-plugin.c |    3 +++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b754ffd..0145325 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-08-25  Felix Riemann  <friemann gnome org>
+
+	* plugins/exif-display/eog-exif-display-plugin.c:
+	Only draw to the GtkDrawingArea when it is realized. Fixes crashes
+	when multiple plugins use the sidebar. Fixes bug #593003.
+
 2009-08-24  Felix Riemann  <friemann gnome org>
 
 	* NEWS: Prepare for initial release.
diff --git a/plugins/exif-display/eog-exif-display-plugin.c b/plugins/exif-display/eog-exif-display-plugin.c
index aa07aa5..febc1f2 100644
--- a/plugins/exif-display/eog-exif-display-plugin.c
+++ b/plugins/exif-display/eog-exif-display-plugin.c
@@ -449,6 +449,9 @@ drawing_area_expose (GtkDrawingArea *drawing_area, GdkEventExpose *event,
 	int scale_factor_y;
 	GtkStyle *gtk_style;
 
+	if (!GTK_WIDGET_REALIZED (GTK_WIDGET (drawing_area)))
+		return;
+
 	draw_channels_histogram = read_gconf_bool_setting (
 			EOG_EXIF_DISPLAY_CONF_UI_DISPLAY_CHANNELS_HISTOGRAM);
 	draw_rgb_histogram = read_gconf_bool_setting (



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