[evolution-patches] [gtkhtml] #67707 embedded widget not drawn on initial expose (invitations in evo)




Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2044
diff -u -p -r1.2044 ChangeLog
--- ChangeLog	28 Sep 2004 20:00:56 -0000	1.2044
+++ ChangeLog	7 Oct 2004 17:36:49 -0000
@@ -1,3 +1,11 @@
+2004-10-07  Radek Doulik  <rodo ximian com>
+
+	* gtkhtml.c (size_allocate): set widget allocation here as gtk
+	does with it's widgets, in case the allocation size doesn't change
+	fire queue_redraw
+
+	Fixes #67707
+
 2004-09-28  Radek Doulik  <rodo ximian com>
 
 	* htmlclueflow.c (save_plain): do not let wi drop under clen. it
Index: gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.576
diff -u -p -r1.576 gtkhtml.c
--- gtkhtml.c	23 Sep 2004 18:43:01 -0000	1.576
+++ gtkhtml.c	7 Oct 2004 17:36:50 -0000
@@ -95,6 +95,7 @@ static GtkTargetEntry dnd_link_sources [
 
 #define d_s(x)
 #define D_IM(x)
+#define d_e(x)
 
 static GtkLayoutClass *parent_class = NULL;
 
@@ -1021,13 +1022,15 @@ unrealize (GtkWidget *widget)
 static gboolean
 expose (GtkWidget *widget, GdkEventExpose *event)
 {
-	/* printf ("expose x: %d y: %d\n", GTK_HTML (widget)->engine->x_offset, GTK_HTML (widget)->engine->y_offset); */
+	d_e (printf ("gtkhtml %p expose x: %d y: %d (%d,%d %d,%d) clue head %p\n", widget, GTK_HTML (widget)->engine->x_offset, GTK_HTML (widget)->engine->y_offset,
+		     event->area.x, event->area.y, event->area.width, event->area.height,
+		     HTML_CLUE (GTK_HTML (widget)->engine->clue)->head));
 
 	html_engine_expose (GTK_HTML (widget)->engine, event);
 
 	if (GTK_WIDGET_CLASS (parent_class)->expose_event)
 		(* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
-	/* printf ("expose END\n"); */
+	d_e (printf ("expose END\n"));
 
 	return FALSE;
 }
@@ -1101,6 +1104,13 @@ size_allocate (GtkWidget *widget, GtkAll
 		html_engine_calc_size (html->engine, NULL);
 		gtk_html_update_scrollbars_on_resize (html, old_doc_width, old_doc_height, old_width, old_height,
 						      &changed_x, &changed_y);
+
+		/* In some cases (invitations in evolution mail view as example) the widget is not redrawn.
+		   So far I wasn't able to find why. Looks like it's dependent on gtk version, so it might be
+		   gtk bug as well. Thus we redraw the widget ourselfs for now */
+		if (allocation->width == widget->allocation.width && allocation->height == widget->allocation.height)
+			gtk_widget_queue_draw (widget);
+		widget->allocation = *allocation;
 	}
 
 	if (!html->engine->keep_scroll) {


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