From 42a8382a4590aea0564bcf7c37440e3a7a84805a Mon Sep 17 00:00:00 2001 From: Sebastian Neuser Date: Mon, 16 Dec 2013 19:42:35 +0100 Subject: [PATCH] Set position on document load only if no page was specified --- zathura.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zathura.c b/zathura.c index 55b72e5..89f06aa 100644 --- a/zathura.c +++ b/zathura.c @@ -786,10 +786,13 @@ document_open(zathura_t* zathura, const char* path, const char* password, gtk_widget_show(zathura->pages[page_id]); } - /* set position */ + /* Set page */ page_set(zathura, zathura_document_get_current_page_number(document)); - if (file_info.position_x != 0 || file_info.position_y != 0) { - position_set(zathura, file_info.position_x, file_info.position_y); + + /* Set position (only if restoring from history file) */ + if (file_info.current_page == zathura_document_get_current_page_number(document) + && (file_info.position_x != 0 || file_info.position_y != 0)) { + position_set(zathura, file_info.position_x, file_info.position_y); } return true;