[evince] [libview] Keep scroll position when reloading
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evince] [libview] Keep scroll position when reloading
- Date: Mon, 23 Nov 2009 13:53:03 +0000 (UTC)
commit bfac656616900acf9ab70e89afaa7f6f5d0307ef
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Mon Nov 23 14:22:37 2009 +0100
[libview] Keep scroll position when reloading
Fixes bgo#602445.
libview/ev-view.c | 12 +++++++++---
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));
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]