+ if(!win->currently_paging) {
+ if(scroll_distance > view_height) {
+ start_paging(win);
+ /* Seriously... */
+ /* COMPAT: */
+#if GTK_CHECK_VERSION(2,14,0)
+ gdk_window_invalidate_rect(gtk_widget_get_window(win->widget), NULL, TRUE);
+#else
+ gdk_window_invalidate_rect(win->widget->window, NULL, TRUE);
+#endif
+ }
+ else if(scroll_distance > 0) {
+ GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(win->widget));
+ gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(win->widget), gtk_text_buffer_get_mark(buffer, "end_position"));
+ while( gtk_events_pending() ) {
+ gtk_main_iteration();
+ }
+ }
+ }