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 543164 - Wrong view when viewing a right-to-left document
Wrong view when viewing a right-to-left document
Status: RESOLVED OBSOLETE
Product: evince
Classification: Core
Component: PDF
2.22.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-15 20:40 UTC by Nicolas Quenouille
Modified: 2018-05-22 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A patch to scroll to the top-right when page scrolling in RTL locales. (788 bytes, patch)
2011-08-20 20:43 UTC, Haggai Eran
none Details | Review

Description Nicolas Quenouille 2008-07-15 20:40:12 UTC
Right-to-left documents are set to a wrong view when they are opened and when you navigate to another page. That is, the horizontal scroll bar is put at the very left and the left part of the document is show-- which is suitable only for left-to-right documents. So, this default behavior should be corrected for RTL documents. The necessity to scroll to right every time you go to another page is really annoying.

To reproduce the bug, make a document in Open Office Writer in a right-to-left language (like Persian) and make a PDF file from it. Open the file in Evince and you will see the problem.
Comment 1 Bartek Kostrzewa 2009-06-20 14:28:07 UTC
Just to check if I understand the problem correctly: when the zoom level is bigger than "fit to width", by default the interface snaps to the upper-left corner of the document which is obviously wrong for an RTL document, where it should snap to the upper-right corner.
Comment 2 Bartek Kostrzewa 2009-06-20 16:20:07 UTC
Well, I think the code to handle this situation should probably be in ev-window.c in ev_window_load_job_cb( .. ) before setup_document_from_metadata(..) in line 1378 (master branch)

the EvDocument structure has a property ui_hints which can have the flag EV_DOCUMENT_UI_HINT_DIRECTION_RTL set from the poppler backend's POPPLER_VIEWER_PREFERENCES_DIRECTION_RTL which is poppler's exposition of the "Direction R2L" keyword of the PDF viewer preferences dictionary.

This is as far as I got because I don't know how to get the view to do what I want at this point.

-Bartek
Comment 3 Haggai Eran 2011-08-19 20:15:01 UTC
It seems to me that the viewer preferences property in poppler isn't implemented yet. See: http://cgit.freedesktop.org/poppler/poppler/tree/glib/poppler-document.cc#n1163
Perhaps in addition to acting on the RTL hint in the document, when using a right-to-left locale, the default should be to open the view to the right-top corner of the document?
Comment 4 Haggai Eran 2011-08-19 20:46:00 UTC
I don't know the code much, but I think a good place to fix this bug would be in the ev_view_scroll_to_page_position function (http://git.gnome.org/browse/evince/tree/libview/ev-view.c#n541). It should scroll the view to the top-right corner of a page, instead of the top-left corner, when required. If I understand correctly, this would make evince scroll the view to the correct position not only when opening a file, but also when navigating to a different page.
Comment 5 Haggai Eran 2011-08-20 20:43:01 UTC
Created attachment 194310 [details] [review]
A patch to scroll to the top-right when page scrolling in RTL locales.

Here's a patch that does what I suggested. I tested it and it works as I expected when changing the page, but not when loading a new document.
I looked in the code of ev_document_changed_cb, and the function will only call ev_view_change_page if the current page is different than the document's current page. Otherwise it just scrolls to keep position. Is there a reason why it shouldn't always scroll to the model's current page when loading a new document?
Comment 6 GNOME Infrastructure Team 2018-05-22 13:24:43 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/evince/issues/67.