Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/libview
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2009-11-23 13:22:37 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2009-11-23 13:22:37 (GMT)
commitbfac656616900acf9ab70e89afaa7f6f5d0307ef (patch)
treee2d72df5e890c6aec8ce3595cd58ce8a0f81484a /libview
parent4fa46f9b6bf7561563c7b720c49d797d4b98259d (diff)
[libview] Keep scroll position when reloading
Fixes bgo#602445.
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-view.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 8c59ec8..36b459c 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));
+ }
}
}