GNOME Bugzilla – Bug 554843
Pressing the Continuous button makes evince display the top of the page
Last modified: 2014-03-02 13:12:43 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"
I confirm this under Gentoo with 2.26
Yes, and it also scrolls vertically to the left. This is annoying.
Still reproducible with 3.9.2.
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
Created attachment 270590 [details] [review] last patch was not working properly
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.
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.
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?
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
(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.