Discussion:
[Okular-devel] [okular] [Bug 357958] New: Viewport is selected inconsistently when navigating with left/right arrow keys
Pastafarianist via KDE Bugzilla
2016-01-14 01:16:41 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=357958

Bug ID: 357958
Summary: Viewport is selected inconsistently when navigating
with left/right arrow keys
Product: okular
Version: 0.20.3
Platform: Gentoo Packages
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
Assignee: okular-***@kde.org
Reporter: ***@gmail.com

Navigating with arrow keys aligns breaks between pages with the center of the
screen instead of aligning pages themselves.

Reproducible: Sometimes

Steps to Reproduce:
1. Open a PDF file (reproducible with identical A4 pages, untested with others)
2. Enable two-page view mode (reproducible in the mode where the 1st page is
paired with the 2nd, 3rd with 4th etc)
3. Enable scaling where pages are adjusted to fit by height
4. Navigate somewhere to the middle of the document by dragging the scrollbar /
using the mouse wheel.
5. Press left or right arrow key.

Actual Results:
Sometimes, instead of fitting pages in the viewport, the break between two
adjacent pairs of pages is aligned with the center of the screen.

Expected Results:
Each time an arrow key is pressed, it works like page up/down, and also aligns
the next pair of pages with the top and bottom edges of the viewport (so that
the pages fit in the viewport entirely, while the next and previous pair aren't
visible).
--
You are receiving this mail because:
You are the assignee for the bug.
Pastafarianist via KDE Bugzilla
2016-01-14 13:28:45 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=357958

--- Comment #1 from Pastafarianist <***@gmail.com> ---
Created attachment 96634
--> https://bugs.kde.org/attachment.cgi?id=96634&action=edit
example.png

Here is what I am talking about. I was reading pages 7-8, then pressed right
arrow and instead of showing only pages 9-10, Okular displayed this.
--
You are receiving this mail because:
You are the assignee for the bug.
Pastafarianist via KDE Bugzilla
2016-01-14 13:29:31 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=357958

Pastafarianist <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #96634|example.png |Example screenshot
description| |
--
You are receiving this mail because:
You are the assignee for the bug.
Blase Johnson
2018-11-17 19:37:26 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=357958

Blase Johnson <***@outlook.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |WORKSFORME
CC| |***@outlook.com
Status|REPORTED |RESOLVED

--- Comment #2 from Blase Johnson <***@outlook.com> ---
(Bugsquad) I tried scrolling large documents using the arrow keys, using facing
pages view and various zoom settings, but in all cases scrolling using either
the left or right arrow key causes the line break with the previous pages to
align with the top of the view, and the position does not change with multiple
scrolls.

Application Version: 1.5.3
KDE Plasma Version: 5.14.3
KDE Frameworks Version: 5.52.0
Qt Version: 5.11.2
--
You are receiving this mail because:
You are the assignee for the bug.
Blase Johnson
2018-11-17 19:37:33 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=357958

Blase Johnson <***@outlook.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Keywords| |triaged
--
You are receiving this mail because:
You are the assignee for the bug.
Tobias Deiminger
2018-11-17 19:58:37 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=357958

Tobias Deiminger <***@posteo.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@posteo.de

--- Comment #3 from Tobias Deiminger <***@posteo.de> ---
I could reproduce the described behavior while working on bug 400890. It has
actually the same root cause, and should be fixed with
https://phabricator.kde.org/D16941. Testing welcome.

(shall we reopen for the meantime?)
--
You are receiving this mail because:
You are the assignee for the bug.
Tobias Deiminger
2018-11-29 20:42:14 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=357958

Tobias Deiminger <***@posteo.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
Latest Commit| |https://commits.kde.org/oku
| |lar/a29e4eaff5889eee632ce93
| |c2e6a313cd9c011a1
Resolution|WORKSFORME |FIXED

--- Comment #4 from Tobias Deiminger <***@posteo.de> ---
Git commit a29e4eaff5889eee632ce93c2e6a313cd9c011a1 by Tobias Deiminger.
Committed on 29/11/2018 at 20:41.
Pushed by tobiasdeiminger into branch 'Applications/18.12'.

Fix inconsistent viewport positioning in PageView

Summary:
This diff unifies the calculation of the viewport position from a given
DocumentViewport. PageView::notifyViewportChanged and
PageView::slotRelayoutPages used to handle it differntly, which resulted in
viewport jumps for no reason.

It happened in various situations, e.g. when jumping to a page using the footer
page navigation, or when reloading the document after presentation mode left,
or when resizing the main window after presentation mode left.

The diff selects the notifyViewportChanged way (align viewport top border with
page top margin) as golden behavior in case of rePos.enabled == false.
Related: bug 341939, bug 400890

341939 and 400890 are fixed partially. These two still suffer from a minor
displacement that happens when finished signal arrives from pixmap generation
thread.

Test Plan:
- When using the footer page navigation to jump to different pages, new page
top is always algined with viewport top.
- After changing page with footer page navigation, press F5 to reload. Page top
stays aligned with viewport top.
- When exiting presentation mode, and touching the file, page top stays aligned
with viewport top.
- When exiting presentation mode, and changing main window size, page top stays
aligned with viewport top.

Reviewers: #okular, sander

Reviewed By: sander

Subscribers: ngraham, sander, aacid, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D16941

A +- -- autotests/data/simple-multipage.pdf
A +82 -0 autotests/data/simple-multipage.tex
M +30 -0 autotests/parttest.cpp
M +37 -30 ui/pageview.cpp
M +1 -0 ui/pageview.h

https://commits.kde.org/okular/a29e4eaff5889eee632ce93c2e6a313cd9c011a1
--
You are receiving this mail because:
You are the assignee for the bug.
Nate Graham
2018-11-29 20:49:42 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=357958

Nate Graham <***@kde.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Version Fixed In| |18.12.0
CC| |***@kde.org
--
You are receiving this mail because:
You are the assignee for the bug.
Loading...