<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>400890</bug_id>
          
          <creation_ts>2018-11-09 21:49:51 +0000</creation_ts>
          <short_desc>Touching file moves the view port</short_desc>
          <delta_ts>2025-01-14 04:08:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>okular</product>
          <component>general</component>
          <version>1.3.0</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Oliver Sander">oliver.sander</reporter>
          <assigned_to name="Okular developers">okular-devel</assigned_to>
          <cc>haxtibal</cc>
    
    <cc>littlegreendude55</cc>
    
    <cc>nate</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1810874</commentid>
    <comment_count>0</comment_count>
    <who name="Oliver Sander">oliver.sander</who>
    <bug_when>2018-11-09 21:49:51 +0000</bug_when>
    <thetext>The following phenomenon is a minor annoyance when using Okular &amp; LaTeX to construct presentations.  It happens every time.

STEPS TO REPRODUCE
1. Open a multi-page pdf document, not on the first page
2. Go to presentation mode
3. Leave presentation mode (by pressing Esc)
4. Observe that the top of the current page aligns with the top of the viewport.
5. Touch the file

OBSERVED RESULT
The document moves such that the top of the current page is now near the center of the viewport.

EXPECTED RESULT
The document should not move.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1810895</commentid>
    <comment_count>1</comment_count>
    <who name="Laura David Hurka">laura.stern</who>
    <bug_when>2018-11-10 00:48:55 +0000</bug_when>
    <thetext>Reproduced with:
Okular Version: 5.1.2
Operating System: KDE neon 5.13
KDE Plasma Version: 5.14.0
Qt Version: 5.11.1
KDE Frameworks Version: 5.50.0

Happens only with continuous mode on; but with different zooms.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817438</commentid>
    <comment_count>2</comment_count>
    <who name="Tobias Deiminger">haxtibal</who>
    <bug_when>2018-11-17 09:14:47 +0000</bug_when>
    <thetext>I researched this for a while, and hope I understand what was going on. Basically, your steps to reproduce cause a notifyViewportChanged event (on presentation mode enter) followed by a slotRelayoutPages event (on reload due to touching the file). rePos.enabled is false in both cases, so default coordinates must be calculated, but this calculation is different for the two events. Therefore the document moves.

Could you please try the patch at https://phabricator.kde.org/D16941 and tell if it fixes the problem for you?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817603</commentid>
    <comment_count>3</comment_count>
    <who name="Oliver Sander">oliver.sander</who>
    <bug_when>2018-11-17 20:14:50 +0000</bug_when>
    <thetext>It *almost* fixes the issue.  Now, when I leave presentation mode the top of the viewport is the bottom of the previous page, i.e., I can see the entire grey horizontal stripe between the current page and the previous one.  That is perfectly fine.

However, when I call &apos;touch&apos; on the file now, the viewport moves up just a few pixels.  I can now see the very bottom of the previous page.

Weirdly enough, I can then scroll up by calling &apos;touch&apos; repeatedly.  Every &apos;touch&apos; moves the viewport a little bit upwards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817607</commentid>
    <comment_count>4</comment_count>
    <who name="Oliver Sander">oliver.sander</who>
    <bug_when>2018-11-17 20:23:56 +0000</bug_when>
    <thetext>Hmm, now I can&apos;t reproduce the &apos;scrolling&apos; part of the previous post anymore... not sure what&apos;s happening.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1822855</commentid>
    <comment_count>5</comment_count>
    <who name="Tobias Deiminger">haxtibal</who>
    <bug_when>2018-11-29 20:42:14 +0000</bug_when>
    <thetext>Git commit a29e4eaff5889eee632ce93c2e6a313cd9c011a1 by Tobias Deiminger.
Committed on 29/11/2018 at 20:41.
Pushed by tobiasdeiminger into branch &apos;Applications/18.12&apos;.

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 357958, bug 341939

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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>