[evolution-patches] gtkhtml: realize fix



When content is loaded before page is realized, nothing is displayed.
(as could be seen in property dialogs - the sample frames located on
2nd, 3rd, ... notebook pages are not shown)

Attached patch fixes this behavior.

Index: htmlengine.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine.c,v
retrieving revision 1.539
diff -u -p -r1.539 htmlengine.c
--- htmlengine.c	1 May 2003 20:53:23 -0000	1.539
+++ htmlengine.c	16 May 2003 12:06:38 -0000
@@ -3635,6 +3635,7 @@ html_engine_init (HTMLEngine *engine)
 	engine->map_table = NULL;
 
 	engine->expose = FALSE;
+	engine->not_updated = FALSE;
 
 	engine->language = NULL;
 }
@@ -3665,6 +3666,9 @@ html_engine_realize (HTMLEngine *e,
 
 	gc_values.function = GDK_INVERT;
 	e->invert_gc = gdk_gc_new_with_values (e->window, &gc_values, GDK_GC_FUNCTION);
+
+	if (e->not_updated)
+		html_engine_schedule_update (e);
 }
 
 void
@@ -3923,7 +3927,7 @@ update_embedded (GtkWidget *widget, gpoi
 static gboolean
 html_engine_update_event (HTMLEngine *e)
 {
-	DI (printf ("html_engine_update_event idle\n");)
+	DI (printf ("html_engine_update_event idle %p\n", e);)
 
 	e->updateTimer = 0;
 
@@ -3932,9 +3936,14 @@ html_engine_update_event (HTMLEngine *e)
 	html_engine_calc_size (e, FALSE);
 
 	if (GTK_LAYOUT (e->widget)->vadjustment == NULL
-	    || ! html_gdk_painter_realized (HTML_GDK_PAINTER (e->painter)))
+	    || ! html_gdk_painter_realized (HTML_GDK_PAINTER (e->painter))) {
+		e->not_updated = TRUE;
 		return FALSE;
-	
+	}
+
+	e->not_updated = FALSE;
+	DI (printf ("continue %p\n", e);)
+
 	/* Adjust the scrollbars */
 	gtk_html_private_calc_scrollbars (e->widget, NULL, NULL);
 
@@ -4050,7 +4059,7 @@ html_engine_timer_event (HTMLEngine *e)
 	gint lastHeight;
 	gboolean retval = TRUE;
 
-	DI (printf ("html_engine_timer_event idle\n");)
+	DI (printf ("html_engine_timer_event idle %p\n", e);)
 
 	/* Has more tokens? */
 	if (!html_tokenizer_has_more_tokens (e->ht) && e->writing) {
Index: htmlengine.h
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine.h,v
retrieving revision 1.167
diff -u -p -r1.167 htmlengine.h
--- htmlengine.h	9 Apr 2003 11:07:38 -0000	1.167
+++ htmlengine.h	16 May 2003 12:06:38 -0000
@@ -270,6 +270,7 @@ struct _HTMLEngine {
 	gint saved_step_count;
 
 	gboolean expose;
+	gboolean not_updated;
 };
 
 /* must be forward referenced *sigh* */


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