From: Carlos Garcia Campos Date: Mon, 23 Nov 2009 13:22:37 +0000 (+0100) Subject: [libview] Keep scroll position when reloading X-Git-Tag: EVINCE_2_29_3~22 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=bfac656616900acf9ab70e89afaa7f6f5d0307ef;p=evince.git [libview] Keep scroll position when reloading Fixes bgo#602445. --- diff --git a/libview/ev-view.c b/libview/ev-view.c index 8c59ec81..36b459ce 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -5164,6 +5164,8 @@ ev_view_document_changed_cb (EvDocumentModel *model, view->loading = FALSE; if (document != view->document) { + gint current_page; + clear_caches (view); if (view->document) { @@ -5178,9 +5180,13 @@ ev_view_document_changed_cb (EvDocumentModel *model, setup_caches (view); } - ev_view_change_page (view, - ev_document_model_get_page (model), - TRUE); + current_page = ev_document_model_get_page (model); + if (view->current_page != current_page) { + ev_view_change_page (view, current_page, TRUE); + } else { + view->pending_scroll = SCROLL_TO_KEEP_POSITION; + gtk_widget_queue_resize (GTK_WIDGET (view)); + } } }