GNOME Bugzilla – Bug 702767
The caret navigation can't move to an unvisited page
Last modified: 2013-07-02 16:15:06 UTC
Using the caret navigation keyboard shorcuts, it is not possible to move to a page that was not visited before, because AFAIK its EvPageCache (needed for the caret navigation to work) is not created until the page is visited for the first time.
Created attachment 247973 [details] [review] Pre-cache some prev/next pages to the current page range
Review of attachment 247973 [details] [review]: ::: libview/ev-page-cache.c @@ +75,3 @@ EV_PAGE_DATA_INCLUDE_ANNOTS) +#define PRE_CACHE_PAGES_N 2 PRE_CACHE_SIZE or PRELOAD_CACHE_SIZE sound a bit better to me. @@ +306,3 @@ +static void +create_job_page_data (EvPageCache *cache, ev_page_cache_schedule_job_if_needed? or something like that. @@ +347,3 @@ + /* Pre-cache some prev/next pages. This is needed for the caret navigation. */ + cache->start_page = MAX (0, start - PRE_CACHE_PAGES_N); + cache->end_page = MIN (end + PRE_CACHE_PAGES_N, cache->n_pages - 1); Don't update cache->start_page/end_page, these represent the current range, so they shouldn't include the preloaded pages. They are used in ev_page_cache_set_flags and mark_dirty to call ev_page_cache_set_page_range again. @@ +352,3 @@ + create_job_page_data (cache, i); + for (i = end + 1; i <= cache->end_page; i++) + create_job_page_data (cache, i); When start/end are clamped it would be useful to cache more pages after/before.
Created attachment 247996 [details] [review] Pre-cache some prev/next pages to the current page range Updated patch according to comments in comment 2.
Comment on attachment 247996 [details] [review] Pre-cache some prev/next pages to the current page range I've reduced to amount of page to pre-cache to 1 (one prev and one next) and simplified a bit the way we schedule the jobs. New patch was pushed already. Thanks!