mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 00:13:47 +01:00
Don't set visibility, update view time, or lookup the cache, if the page is already visible.
This also has the side effect of not flooding the console with debug messages on every change of the vertical adjustment as a result of redundant cache lookups. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
9a00028a0d
commit
cd381c813d
@ -94,9 +94,11 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi
|
||||
zathura->ui.session->gtk.view, 0, 0, &page_rect.x, &page_rect.y);
|
||||
|
||||
if (gdk_rectangle_intersect(&view_rect, &page_rect, NULL) == TRUE) {
|
||||
zathura_page_set_visibility(page, true);
|
||||
zathura_page_widget_update_view_time(ZATHURA_PAGE(page_widget));
|
||||
zathura_page_cache_add(zathura, zathura_page_get_index(page));
|
||||
if (zathura_page_get_visibility(page) == false) {
|
||||
zathura_page_set_visibility(page, true);
|
||||
zathura_page_widget_update_view_time(ZATHURA_PAGE(page_widget));
|
||||
zathura_page_cache_add(zathura, zathura_page_get_index(page));
|
||||
}
|
||||
if (zathura->global.update_page_number == true && updated == false
|
||||
&& gdk_rectangle_intersect(¢er, &page_rect, NULL) == TRUE) {
|
||||
zathura_document_set_current_page_number(zathura->document, page_id);
|
||||
|
Loading…
Reference in New Issue
Block a user