don't create layout if we didn't have one (gtk_text_view_set_buffer):

2001-10-24  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (gtk_text_view_update_adjustments): don't
	create layout if we didn't have one
	(gtk_text_view_set_buffer): invalidate so we get the idle handlers
	as appropriate, avoids blanking the screen
	(gtk_text_view_invalidate): new function to do invalidation,
	containing old guts of invalidated_handler
This commit is contained in:
Havoc Pennington 2001-10-24 16:11:41 +00:00 committed by Havoc Pennington
parent 679ca1ae86
commit 4e8cbdca6b
8 changed files with 82 additions and 9 deletions

View File

@ -1,3 +1,12 @@
2001-10-24 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_adjustments): don't
create layout if we didn't have one
(gtk_text_view_set_buffer): invalidate so we get the idle handlers
as appropriate
(gtk_text_view_invalidate): new function to do invalidation,
containing old guts of invalidated_handler
Wed Oct 24 10:29:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkalignment.c (gtk_alignment_class_init): Improve

View File

@ -1,3 +1,12 @@
2001-10-24 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_adjustments): don't
create layout if we didn't have one
(gtk_text_view_set_buffer): invalidate so we get the idle handlers
as appropriate
(gtk_text_view_invalidate): new function to do invalidation,
containing old guts of invalidated_handler
Wed Oct 24 10:29:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkalignment.c (gtk_alignment_class_init): Improve

View File

@ -1,3 +1,12 @@
2001-10-24 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_adjustments): don't
create layout if we didn't have one
(gtk_text_view_set_buffer): invalidate so we get the idle handlers
as appropriate
(gtk_text_view_invalidate): new function to do invalidation,
containing old guts of invalidated_handler
Wed Oct 24 10:29:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkalignment.c (gtk_alignment_class_init): Improve

View File

@ -1,3 +1,12 @@
2001-10-24 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_adjustments): don't
create layout if we didn't have one
(gtk_text_view_set_buffer): invalidate so we get the idle handlers
as appropriate
(gtk_text_view_invalidate): new function to do invalidation,
containing old guts of invalidated_handler
Wed Oct 24 10:29:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkalignment.c (gtk_alignment_class_init): Improve

View File

@ -1,3 +1,12 @@
2001-10-24 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_adjustments): don't
create layout if we didn't have one
(gtk_text_view_set_buffer): invalidate so we get the idle handlers
as appropriate
(gtk_text_view_invalidate): new function to do invalidation,
containing old guts of invalidated_handler
Wed Oct 24 10:29:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkalignment.c (gtk_alignment_class_init): Improve

View File

@ -1,3 +1,12 @@
2001-10-24 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_adjustments): don't
create layout if we didn't have one
(gtk_text_view_set_buffer): invalidate so we get the idle handlers
as appropriate
(gtk_text_view_invalidate): new function to do invalidation,
containing old guts of invalidated_handler
Wed Oct 24 10:29:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkalignment.c (gtk_alignment_class_init): Improve

View File

@ -1,3 +1,12 @@
2001-10-24 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_adjustments): don't
create layout if we didn't have one
(gtk_text_view_set_buffer): invalidate so we get the idle handlers
as appropriate
(gtk_text_view_invalidate): new function to do invalidation,
containing old guts of invalidated_handler
Wed Oct 24 10:29:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkalignment.c (gtk_alignment_class_init): Improve

View File

@ -291,6 +291,7 @@ static void gtk_text_view_queue_scroll (GtkTextView *text_view,
static gboolean gtk_text_view_flush_scroll (GtkTextView *text_view);
static void gtk_text_view_update_adjustments (GtkTextView *text_view);
static void gtk_text_view_invalidate (GtkTextView *text_view);
static void gtk_text_view_update_im_spot_location (GtkTextView *text_view);
@ -1099,6 +1100,8 @@ gtk_text_view_set_buffer (GtkTextView *text_view,
if (GTK_WIDGET_VISIBLE (text_view))
gtk_widget_queue_draw (GTK_WIDGET (text_view));
gtk_text_view_invalidate (text_view);
}
static GtkTextBuffer*
@ -1564,6 +1567,7 @@ gtk_text_view_update_adjustments (GtkTextView *text_view)
DV(g_print(">Updating adjustments ("G_STRLOC")\n"));
if (text_view->layout)
gtk_text_layout_get_size (text_view->layout, &width, &height);
if (text_view->width != width || text_view->height != height)
@ -2796,13 +2800,8 @@ incremental_validate_callback (gpointer data)
}
static void
invalidated_handler (GtkTextLayout *layout,
gpointer data)
gtk_text_view_invalidate (GtkTextView *text_view)
{
GtkTextView *text_view;
text_view = GTK_TEXT_VIEW (data);
text_view->onscreen_validated = FALSE;
DV(g_print(">Invalidate, onscreen_validated = FALSE ("G_STRLOC")\n"));
@ -2822,6 +2821,17 @@ invalidated_handler (GtkTextLayout *layout,
}
}
static void
invalidated_handler (GtkTextLayout *layout,
gpointer data)
{
GtkTextView *text_view;
text_view = GTK_TEXT_VIEW (data);
gtk_text_view_invalidate (text_view);
}
static void
changed_handler (GtkTextLayout *layout,
gint start_y,