Bug 201669 - Scrolling in thumbnails view is broken
Summary: Scrolling in thumbnails view is broken
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-27 16:15 UTC by Bernhard Jungk
Modified: 2010-07-29 00:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch (1.28 KB, patch)
2010-05-11 23:09 UTC, Sergio PR
Details
Second patch: corrects the scrolling bug (2.86 KB, patch)
2010-05-11 23:57 UTC, Sergio PR
Details
scoll patch (11.05 KB, patch)
2010-07-25 03:29 UTC, Mathieu Lornac
Details
patch (11.98 KB, patch)
2010-07-27 16:19 UTC, Mathieu Lornac
Details
patch (13.39 KB, patch)
2010-07-28 05:08 UTC, Mathieu Lornac
Details
fixes the positionning problem (13.38 KB, patch)
2010-07-28 15:08 UTC, Mathieu Lornac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Jungk 2009-07-27 16:15:02 UTC
Version:            (using KDE 4.2.98)
OS:                Linux
Installed from:    Ubuntu Packages

Scrolling in the thumbnails view works for one page only. When I hit the bottom or top of the current page, the view "hops" to the bottom half of the previous page and the top half of the current page and then stays there.
Comment 1 Albert Astals Cid 2009-07-27 19:39:06 UTC
You mean dragging the green bordered rectangle?
Comment 2 Bernhard Jungk 2009-07-27 20:19:24 UTC
Yes, I meant dragging the rectangle, scrolling the thumbnails view works. My fault, sorry.
Comment 3 Matty 2009-10-09 20:51:40 UTC
Same problem here, using KDE 4.3.2, Okular 0.9.2
Comment 4 Sergio PR 2010-05-06 12:22:46 UTC
It's still happening on KDE 4.4.3 (Okular 0.10.3).

I recorded a video showing the problem: https://dl.dropbox.com/u/1040020/Videos/OkularThumbnails.ogv
Comment 5 Sergio PR 2010-05-06 12:25:30 UTC
BTW vote this bug in order to be attended by the developers! I gave 10 votes to it :)
Comment 6 Albert Astals Cid 2010-05-06 19:48:24 UTC
Of course it's not fixed, do you see it marked as fixed?

And no, you do not need to vote to make us aware of it, we are aware of it, we just do not have time to fix it, so the only thing that is going to help getting a fix faster is:
 * You fix it
 * You find someone to fix it
 * You somehow get our days to last more than 24 hours
Comment 7 Sergio PR 2010-05-06 20:01:18 UTC
Take it easy, I didn't want to upset you (as you seem to be).

This bug appears as unconfirmed so I thought you weren't able to reproduce it or something like that, it could be even fixed without intention (you know, "collateral effects" when programming are not only new bugs :P), so I reported that the bug persists and I even recorded a video to show you the problem in case you didn't see it.

I'm sorry if I bothered you, that wasn't my intention.
Comment 8 Albert Astals Cid 2010-05-06 20:55:55 UTC
Ok, accept my apologies if my comment was harsh, now, where's my patch? ;-)
Comment 9 Sergio PR 2010-05-09 19:53:31 UTC
I really tried to find this bug but I wasn't able to do it... :(

I looked for it in okular/ui/thumbnailslist.cpp but I didn't found it there or it's not that obvious. I suspect it's in ThumbnailListPrivate::forwardTrack or in Document::setViewport, but I couldn't test it any further as I wasn't able to compile it!! T_T

I'll try to provide you a patch, I promise, but don't expect anything :P
Comment 10 Albert Astals Cid 2010-05-10 17:01:28 UTC
About compiling, this might help http://okular.kde.org/download.php
About the bug, the problem is in for sure not in Document:: it is either in ThumbnailListPrivate::mouseMoveEvent or in ThumbnailListPrivate::forwardTrack
Comment 11 Sergio PR 2010-05-11 00:03:00 UTC
Thank you! I compiled it :)

I fixed the bug, it was in ThumbnailListPrivate::forwardTrack. By fixing this bug, I discovered another one related to dragging the selected area in the thumbnail list, I hope I can give you a patch as soon as possible :D
Comment 12 Albert Astals Cid 2010-05-11 20:49:07 UTC
Can you please attach the patch?
Comment 13 Sergio PR 2010-05-11 23:07:53 UTC
Ok, here you are :)

Now there is a bug when you're dragging the highlighted area in the thumbnail list that occurs when you change from one page to another and that provokes the thumbnail list to be scrolled, so the relative position of the mouse cursor to the original grab point results in an annoying jump.
Comment 14 Sergio PR 2010-05-11 23:09:12 UTC
Created attachment 43492 [details]
Patch

I hope this patch fixes this bug :)

The spaces and tabs may not be right, I had some problems dealing with it in Kwrite T_T
Comment 15 Sergio PR 2010-05-11 23:57:40 UTC
Created attachment 43495 [details]
Second patch: corrects the scrolling bug

This patch also fixes the scrolling bug, but I think it could be done better (my knowledge about Qt is very low :P).
Comment 16 Mathieu Lornac 2010-07-25 03:29:18 UTC
Created attachment 49471 [details]
scoll patch

Allows you to scroll in the thumbnails as you can do in the main view window.
Works in all view modes.
Comment 17 Albert Astals Cid 2010-07-27 00:42:45 UTC
Hi Mathieu, the patch looks impressive, some things i'd like you to fix though:
 * Minor nitpicks:
   * Please do not include ¿vim? modelines in the files
   * For enums use capital first letter, i.e. ChangePageDirection
   * For enum values use capital first letter too, i.e. Null
   * You have some weird indenting like
+    else if (Okular::Settings::viewMode() == Okular::Settings::EnumViewMode::FacingFirstCentered )
+        {
+            facingFirst = 1;
+            reason = 2;
+        }
     please make sure the {} are on the same indenting level than the previos like if or else

And now some real problems with the behaviour:
 * Select Fit Page, click on a page (not the first one) so you get only that page and the green border surrounds the page, now go to the thumbnail view, and press and drag down, see how the green border "jumps" up to cover the previous page.
 * If when dragging the current page changes from one to another on the main view there is a weird effect in which it seems that the next (or previous?) page is painted for a very small moment and then the correct page is painted again very fast

Could you please investigate these issues?
Comment 18 Mathieu Lornac 2010-07-27 16:19:17 UTC
Created attachment 49534 [details]
patch

I fixed the behavior bugs and the malformed enumed names.

Sorry for the indentation problem, i'm having trouble configuring emacs with this coding style.

The display bug was caused by a call to setViewportPage() and then a call to set the new viewport position, i changed these calls to update the display in one time.

The other behavior bug was caused by a bad initialasation in a particular case.

I hope the patch is now correct.
Comment 19 Albert Astals Cid 2010-07-27 22:59:47 UTC
I can still reproduce this problem:
 * Select Fit Page
 * Click on a page (not the first one and one outside the shaded/green area) on the thumbnail view
 * Press and drag down, see how the green border "jumps" up to cover the previous
page
Comment 20 Albert Astals Cid 2010-07-27 23:03:26 UTC
When i say "Press and drag down, see how the green border "jumps" up to cover the
previous page" i mean "Press in the shaded/green area and drag down, see how the green border "jumps" up to cover the previous page"
Comment 21 Mathieu Lornac 2010-07-28 05:08:46 UTC
Created attachment 49562 [details]
patch

Works with the thumbnail filter.
The half jump page bug is fixed.

A minor disagreement still exists, with a high zoom level, when you select a new thumbnail by clicking it, the viewport is not exactly centered at the top of the page.
I don't know if this behavior can be considered as correct or not.

I don't understand why this happens yet, the viewport repositioning is made in the function mouseReleaseEvent around the lines 770 (with the patch applied).
Comment 22 Mathieu Lornac 2010-07-28 15:08:25 UTC
Created attachment 49581 [details]
fixes the positionning problem

I was using the rect()->height instead of the pixmapHeight to calculate the center position.
Comment 23 Albert Astals Cid 2010-07-28 23:43:33 UTC
SVN commit 1156320 by aacid:

Allow dragging in thumbnails view to drag from one page to other
Patch by Mathieu Lornac
Will *not* be in KDE 4.5.0
Might backport it to stable branch for some KDE 4.5.x if noone finds any problem
BUGS: 201669


 M  +230 -82   thumbnaillist.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1156320