GNOME Bugzilla – Bug 112835
GtkTextView places cursor onscreen on focus gain
Last modified: 2004-12-22 21:47:04 UTC
When a GtkTextView gains focus (through gtk_widget_grab_focus for example), it appears GtkTextView calls gtk_text_view_place_cursor_onscreen to make the cursor position appear on screen. This causes lots of grief in gedit, anjuta2 and other apps which use a GtkNotebook based MDI approach. When you've scrolled down a file and then changes tabs in gedit and move back, you get to scroll all the way down again since the text view moved the scrollbar all the way back to the top (where the cursor is). This is the wrong behavior imo.
See the gtk_text_view_grab_focus in gtktextview.c (line 4236) and the disable_scroll_on_focus variable. What's the reasoning behind scrolling to the cursor position on grab_focus?
*** This bug has been marked as a duplicate of 81893 ***