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 724273 - If caret navigation support enabled, CTRL+HOME, CTRL+END, CTRL+SHIFT+HOME, CTRL+SHIFT+END, PAGEUP, PAGEDOWN keys doesn't doing the proper cursor movement operations
If caret navigation support enabled, CTRL+HOME, CTRL+END, CTRL+SHIFT+HOME, CT...
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-13 07:24 UTC by Hammer Attila
Modified: 2014-07-25 08:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch for Ctrl+Home/End (5.79 KB, patch)
2014-04-28 13:50 UTC, Joanmarie Diggs (IRC: joanie)
needs-work Details | Review
Scroll to the start/end of the document when pressing <Ctrl>Home/End (3.05 KB, patch)
2014-07-24 09:52 UTC, Antía Puentes
committed Details | Review
Move the caret to the beggining/end of the doc when pressing <Ctr>Home/end (3.04 KB, patch)
2014-07-24 09:54 UTC, Antía Puentes
accepted-commit_now Details | Review
Move the caret to the beggining/end of the doc when pressing <Ctr>Home/end (3.65 KB, patch)
2014-07-24 16:12 UTC, Antía Puentes
committed Details | Review

Description Hammer Attila 2014-02-13 07:24:13 UTC
Dear Developers,

If caret navigation support enabled, CTRL+HOME, CTRL+END, CTRL+SHIFT+HOME, CTRL+SHIFT+END, PAGEUP, PAGEDOWN keys doesn't doing the proper cursor movement operations.
Reproducation steps:
1. Launch Evince, and open a PDF file.
2. Enable caret navigation support with F7 key, and click enable button.
3. Try using general cursor movement operations, the list:
CTRL+HOME: jump top of the document.
CTRL+END: jump end of the document.
CTRL+SHIFT+HOME: select from cursor to top of the document.
CTRL+SHIFT+END: select from cursor to end of the document.
PAGEUP: large scroll caret up.
PAGEDOWN: large scroll caret down.
Expected result: this general cursor movement operations need doing general tasks, similar for example the Gedit or Libreoffice Writer applications.
Actual result: this general cursor movement key combinations now nothing doing.
I experience similar issue with CTRL+SHIFT+UP and CTRL+SHIFT+DOWN keystrokes (select paragraph the proper direction).

I reproduced this issue both Evince 3.11.3 version and Evince 3.10.3 version in my Ubuntu 14.04 system.

Attila
Comment 1 Hammer Attila 2014-02-13 07:30:35 UTC
Yesterday reported this issue downstream level in Launchpad.net, bugreport link is following:
https://bugs.launchpad.net/bugs/1279387

Attila
Comment 2 Joel Uckelman 2014-04-24 09:11:32 UTC
With evince 3.10.3 on my Fedora 20 system, whether caret navigation is on makes no difference: If the evince window is narrower than the document (i.e., a horizontal scroll bar is showing), then Ctrl+Home and Ctrl+End shift the document to the extreme left and extreme right, respectively, rather than to the extreme top and extreme bottom like they should. However, Ctrl+Home and Ctrl+End work properly when there is no horizontal scroll bar, and First Page and Last Page in the "gear" work properly in all cases.

Here's the downstream bug report:

https://bugzilla.redhat.com/show_bug.cgi?id=1068323
Comment 3 Joanmarie Diggs (IRC: joanie) 2014-04-28 13:50:04 UTC
Created attachment 275354 [details] [review]
Proposed patch for Ctrl+Home/End

This patch just address Ctrl+Home/End, though it does it both for caret browsing (what this bug is about) and for scrolling (the subsequent comment).

An additional fix will be needed for selection with Ctrl+Home/End. Ditto for caret navigation with Page Up/Down.
Comment 4 Carlos Garcia Campos 2014-06-23 09:34:12 UTC
Review of attachment 275354 [details] [review]:

If the view is now handling CTRL+Home/end I think we should remove the accelerators from the window, since they are inconsistent now (they go to first/last page, not begin/end document). I think you could split this patch.

::: libview/ev-view.c
@@ +5318,3 @@
+		return FALSE;
+
+	ev_page_cache_ensure_page (view->page_cache, 0);

This doesn't work, because it's async, it just schedules the job. I'm not sure how to solve this, though.

@@ +5333,3 @@
+
+	last_page = ev_document_get_n_pages (view->document) - 1;
+	ev_page_cache_ensure_page (view->page_cache, last_page);

Ditto.

@@ +8480,3 @@
+
+gboolean
+ev_view_document_start (EvView *view)

Why is this boolean? This should probably be called ev_view_first_page instead.

@@ +8490,3 @@
+
+gboolean
+ev_view_document_end (EvView *view)

Same here. CTRL + End goes to the document end, but this method jumps to the last page of the document.

@@ +8494,3 @@
+	g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
+
+	ev_document_model_set_page (view->model, ev_document_get_n_pages (view->document) - 1);

You should check there's a document already, maybe that justifies these methods to be boolean and return FALSE when view->document is NULL.
Comment 5 Antía Puentes 2014-07-24 09:52:49 UTC
Created attachment 281564 [details] [review]
Scroll to the start/end of the document when pressing <Ctrl>Home/End

Scroll to the beggining/end of the doc instead of scrolling to the first/last page. In other words, <Ctrl>End goes to the end of the last page, instead of going to the beggining of that page.

The <Ctrl>Home/End keyboard shortcuts are now managed by the view, instead of by the window.
Comment 6 Antía Puentes 2014-07-24 09:54:08 UTC
Created attachment 281565 [details] [review]
Move the caret to the beggining/end of the doc when pressing <Ctr>Home/end
Comment 7 Antía Puentes 2014-07-24 09:57:57 UTC
Both patches are based on Joanie's work in her attached patch.

The second patch early caches the first and last page because this info should be available to be able to move to beggining/end of the document.
Comment 8 Carlos Garcia Campos 2014-07-24 10:59:57 UTC
Review of attachment 281564 [details] [review]:

LGTM, thanks!. Please remember to add the bug URL in the commit message before pushing.
Comment 9 Carlos Garcia Campos 2014-07-24 14:43:39 UTC
Review of attachment 281565 [details] [review]:

Ok

::: libview/ev-view.c
@@ +7289,3 @@
+		   because <Ctr>Home/End need that information */
+		ev_page_cache_ensure_page (view->page_cache, 0);
+		ev_page_cache_ensure_page (view->page_cache, n_pages - 1);

This is a bit hacky but I don't see any other solution, so let's do this for now.
Comment 10 Carlos Garcia Campos 2014-07-24 15:18:47 UTC
Comment on attachment 281564 [details] [review]
Scroll to the start/end of the document when pressing <Ctrl>Home/End

Pushed to git master
Comment 11 Antía Puentes 2014-07-24 16:12:30 UTC
Created attachment 281616 [details] [review]
 Move the caret to the beggining/end of the doc when pressing <Ctr>Home/end
Comment 12 Antía Puentes 2014-07-24 16:13:40 UTC
(In reply to comment #9)
> Review of attachment 281565 [details] [review]:
> 
> Ok
> 
> ::: libview/ev-view.c
> @@ +7289,3 @@
> +           because <Ctr>Home/End need that information */
> +        ev_page_cache_ensure_page (view->page_cache, 0);
> +        ev_page_cache_ensure_page (view->page_cache, n_pages - 1);
> 
> This is a bit hacky but I don't see any other solution, so let's do this for
> now.

I have updated the patch to load the first and last pages only in case the caret navigation is enabled ( attachment 281616 [details] [review] )
Comment 13 Carlos Garcia Campos 2014-07-25 08:37:02 UTC
Comment on attachment 281616 [details] [review]
 Move the caret to the beggining/end of the doc when pressing <Ctr>Home/end 

Pushed with some minor changes.