From 7cdd1e7719d6ab1d491dbeead002d84c0bf6f58a Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Sat, 6 Jul 2013 21:55:35 +0200 Subject: [PATCH] refresh horizontal position in page_set After page_set cb_view_hadjustment_changed must be called so that when zoom-center is enabled, the page is recentered. Signed-off-by: Sebastian Ramacher --- shortcuts.c | 7 ------- zathura.c | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 87d5c41..244ada1 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -333,9 +333,6 @@ sc_goto(girara_session_t* session, girara_argument_t* argument, girara_event_t* page_set(zathura, zathura_document_get_number_of_pages(zathura->document) - 1); } - /* adjust horizontal position */ - GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(session->gtk.view)); - cb_view_hadjustment_changed(hadjustment, zathura); zathura_jumplist_add(zathura); return false; @@ -472,10 +469,6 @@ sc_navigate(girara_session_t* session, girara_argument_t* argument, page_set(zathura, new_page); - /* adjust horizontal position */ - GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(session->gtk.view)); - cb_view_hadjustment_changed(hadjustment, zathura); - return false; } diff --git a/zathura.c b/zathura.c index 0165e40..d4d638d 100644 --- a/zathura.c +++ b/zathura.c @@ -1031,6 +1031,9 @@ page_set(zathura_t* zathura, unsigned int page_id) zathura_adjustment_set_value(view_hadjustment, offset.x); zathura_adjustment_set_value(view_vadjustment, offset.y); + /* refresh horizontal adjustment, to honor zoom-center */ + cb_view_hadjustment_changed(view_hadjustment, zathura); + statusbar_page_number_update(zathura); return true;