Apply patch from Gustavo Giraldez for bug #78513

2002-07-24  Havoc Pennington  <hp@pobox.com>

	* gtk/gtktextview.c: Apply patch from Gustavo
	Giraldez for bug #78513
This commit is contained in:
Havoc Pennington 2002-07-25 02:52:44 +00:00 committed by Havoc Pennington
parent 279951fe46
commit 394ae506ba
7 changed files with 53 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2002-07-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextview.c: Apply patch from Gustavo
Giraldez for bug #78513
Wed Jul 24 16:43:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c docs/references/tmpl/gtkrc.sgml: Don't use

View File

@ -1,3 +1,8 @@
2002-07-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextview.c: Apply patch from Gustavo
Giraldez for bug #78513
Wed Jul 24 16:43:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c docs/references/tmpl/gtkrc.sgml: Don't use

View File

@ -1,3 +1,8 @@
2002-07-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextview.c: Apply patch from Gustavo
Giraldez for bug #78513
Wed Jul 24 16:43:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c docs/references/tmpl/gtkrc.sgml: Don't use

View File

@ -1,3 +1,8 @@
2002-07-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextview.c: Apply patch from Gustavo
Giraldez for bug #78513
Wed Jul 24 16:43:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c docs/references/tmpl/gtkrc.sgml: Don't use

View File

@ -1,3 +1,8 @@
2002-07-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextview.c: Apply patch from Gustavo
Giraldez for bug #78513
Wed Jul 24 16:43:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c docs/references/tmpl/gtkrc.sgml: Don't use

View File

@ -1,3 +1,8 @@
2002-07-24 Havoc Pennington <hp@pobox.com>
* gtk/gtktextview.c: Apply patch from Gustavo
Giraldez for bug #78513
Wed Jul 24 16:43:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c docs/references/tmpl/gtkrc.sgml: Don't use

View File

@ -1512,6 +1512,16 @@ free_pending_scroll (GtkTextPendingScroll *scroll)
g_free (scroll);
}
static void
cancel_pending_scroll (GtkTextView *text_view)
{
if (text_view->pending_scroll)
{
free_pending_scroll (text_view->pending_scroll);
text_view->pending_scroll = NULL;
}
}
static void
gtk_text_view_queue_scroll (GtkTextView *text_view,
GtkTextMark *mark,
@ -1541,8 +1551,7 @@ gtk_text_view_queue_scroll (GtkTextView *text_view,
g_object_ref (G_OBJECT (scroll->mark));
if (text_view->pending_scroll)
free_pending_scroll (text_view->pending_scroll);
cancel_pending_scroll (text_view);
text_view->pending_scroll = scroll;
}
@ -2428,11 +2437,7 @@ gtk_text_view_finalize (GObject *object)
gtk_text_view_destroy_layout (text_view);
gtk_text_view_set_buffer (text_view, NULL);
if (text_view->pending_scroll)
{
free_pending_scroll (text_view->pending_scroll);
text_view->pending_scroll = NULL;
}
cancel_pending_scroll (text_view);
if (text_view->tabs)
pango_tab_array_free (text_view->tabs);
@ -3052,11 +3057,14 @@ gtk_text_view_flush_first_validate (GtkTextView *text_view)
}
else
{
/* scroll to any marks, if that's pending. This can
* jump us to the validation codepath used for scrolling
* onscreen, if so we bail out.
/* scroll to any marks, if that's pending. This can jump us to
* the validation codepath used for scrolling onscreen, if so we
* bail out. It won't jump if already in that codepath since
* value_changed is not recursive, so also validate if
* necessary.
*/
if (!gtk_text_view_flush_scroll (text_view))
if (!gtk_text_view_flush_scroll (text_view) ||
!text_view->onscreen_validated)
gtk_text_view_validate_onscreen (text_view);
DV(g_print(">Leaving first validate idle ("G_STRLOC")\n"));
@ -4628,6 +4636,8 @@ gtk_text_view_scroll_pages (GtkTextView *text_view,
g_return_if_fail (text_view->vadjustment != NULL);
cancel_pending_scroll (text_view);
adj = text_view->vadjustment;
/* Validate the region that will be brought into view by the cursor motion
@ -4702,6 +4712,8 @@ gtk_text_view_scroll_hpages (GtkTextView *text_view,
g_return_if_fail (text_view->hadjustment != NULL);
cancel_pending_scroll (text_view);
adj = text_view->hadjustment;
/* Validate the line that we're moving within.