Commit 4e8cbdca authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

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
parent 679ca1ae
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
......
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
......
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
......
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
......
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
......
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
......
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
......
......@@ -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);
......@@ -1096,9 +1097,11 @@ gtk_text_view_set_buffer (GtkTextView *text_view,
gtk_text_buffer_add_selection_clipboard (text_view->buffer,
gtk_clipboard_get (GDK_SELECTION_PRIMARY));
}
if (GTK_WIDGET_VISIBLE (text_view))
gtk_widget_queue_draw (GTK_WIDGET (text_view));
gtk_text_view_invalidate (text_view);
}
static GtkTextBuffer*
......@@ -1563,8 +1566,9 @@ gtk_text_view_update_adjustments (GtkTextView *text_view)
gint width = 0, height = 0;
DV(g_print(">Updating adjustments ("G_STRLOC")\n"));
gtk_text_layout_get_size (text_view->layout, &width, &height);
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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment