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 554843 - Pressing the Continuous button makes evince display the top of the page
Pressing the Continuous button makes evince display the top of the page
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
2.24.x
Other Linux
: Normal minor
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-10-03 12:28 UTC by Pedro Villavicencio
Modified: 2014-03-02 13:12 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
added a ev_scroll_to_same_position function that scrolls to the position of the document at the moment of changing "continuous" option (1.96 KB, patch)
2014-02-27 16:21 UTC, Bogdan Petcu
none Details | Review
last patch was not working properly (2.22 KB, patch)
2014-02-28 18:45 UTC, Bogdan Petcu
needs-work Details | Review
libview: Try to keep the scroll position when switching between continuous and non continuous mode (1.20 KB, patch)
2014-03-01 19:30 UTC, Carlos Garcia Campos
committed Details | Review
This now seems to work properly. Adding the code here makes the implementation independent from other scroll_to_page_position calls. (1.06 KB, patch)
2014-03-01 21:05 UTC, Bogdan Petcu
reviewed Details | Review

Description Pedro Villavicencio 2008-10-03 12:28:46 UTC
this report has been opened here:

https://bugs.edge.launchpad.net/ubuntu/+source/evince/+bug/276749

"When reading a document with evince, I can't make it display the document continously without switching to the top of the current page.

To reproduce, open a document in evince,
make sure that "Continuous" is unchecked in "View" Menu
scroll to the bottom of the page
click "continuous" from View Menu
see evince scrolling up to the top of the page"
Comment 1 Pacho Ramos 2009-10-15 16:58:29 UTC
I confirm this under Gentoo with 2.26
Comment 2 Sebastian Krämer 2011-03-09 15:51:17 UTC
Yes, and it also scrolls vertically to the left. This is annoying.
Comment 3 Germán Poo-Caamaño 2013-06-15 06:45:46 UTC
Still reproducible with 3.9.2.
Comment 4 Bogdan Petcu 2014-02-27 16:21:44 UTC
Created attachment 270491 [details] [review]
added a ev_scroll_to_same_position function that scrolls to the position of the document at the moment of changing "continuous" option
Comment 5 Bogdan Petcu 2014-02-28 18:45:19 UTC
Created attachment 270590 [details] [review]
last patch was not working properly
Comment 6 Carlos Garcia Campos 2014-03-01 10:36:54 UTC
Review of attachment 270590 [details] [review]:

Thanks for the patch, I think it 's a good idea but we can do it better, see below.

::: libview/ev-view.c
@@ +606,3 @@
+		scroll_to_point (view, current_x + view->scroll_x, current_y + view->scroll_y, orientation);
+	} else {
+		ev_view_scroll_to_page_position (view, orientation);

So, this only works when switching from non-continuous to continuous.

@@ +7166,2 @@
 	view->continuous = continuous;
+	view->pending_scroll = SCROLL_TO_SAME_POSITION;

I don't think we need to add a new pending scroll type. We could use the scroll to page position, but using a pending point. Here you convert the view point (scroll_x, scroll_y) to a doc point saving it in view->pending_point. Then scroll to page position will move to that doc point. Since we are using the doc point, it will be converted to the right view point in both continuous and non-continuous mode, and this will work also when switching to non-continuous.
Comment 7 Bogdan Petcu 2014-03-01 16:56:18 UTC
Is this what you meant: http://pastebin.com/xuh2ugwh ? or am I getting it wrong?
It seems that this is not working.

Regarding the new pending scroll type I thought that it is needed because scroll_to_page_position is also used for moving from one page to another. For example being at the end of one page and clicking next will move to the bottom of the next page.
Comment 8 Carlos Garcia Campos 2014-03-01 19:30:29 UTC
Created attachment 270642 [details] [review]
libview: Try to keep the scroll position when switching between continuous and non continuous mode

Doesn't something like this work?
Comment 9 Bogdan Petcu 2014-03-01 21:05:03 UTC
Created attachment 270649 [details] [review]
This now seems to work properly. Adding the code here makes the implementation independent from other scroll_to_page_position calls.

I added that +2 because when switching from not-continuous to continuous the position provided was just a little bit higher than what expected
Comment 10 Carlos Garcia Campos 2014-03-02 13:12:11 UTC
(In reply to comment #9)
> Created an attachment (id=270649) [details] [review]
> This now seems to work properly. Adding the code here makes the implementation
> independent from other scroll_to_page_position calls.
> 
> I added that +2 because when switching from not-continuous to continuous the
> position provided was just a little bit higher than what expected

Which sounds like a bug, adding that +2 simply hides more the actual bug. It was actually a combination of different bugs that I've just fixed in git master together with my patch that should work fine now.