After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702767 - The caret navigation can't move to an unvisited page
The caret navigation can't move to an unvisited page
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-20 17:59 UTC by Antía Puentes
Modified: 2013-07-02 16:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Pre-cache some prev/next pages to the current page range (3.04 KB, patch)
2013-06-28 12:12 UTC, Antía Puentes
needs-work Details | Review
Pre-cache some prev/next pages to the current page range (3.26 KB, patch)
2013-06-28 15:39 UTC, Antía Puentes
committed Details | Review

Description Antía Puentes 2013-06-20 17:59:08 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.
Comment 1 Antía Puentes 2013-06-28 12:12:02 UTC
Created attachment 247973 [details] [review]
Pre-cache some prev/next pages to the current page range
Comment 2 Carlos Garcia Campos 2013-06-28 12:33:21 UTC
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.
Comment 3 Antía Puentes 2013-06-28 15:39:23 UTC
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 4 Carlos Garcia Campos 2013-07-02 16:14:58 UTC
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!