GNOME Bugzilla – Bug 709375
The accessible cache should be cleared when setting the model
Last modified: 2013-10-04 15:02:43 UTC
Created attachment 256400 [details] [review] proposed patch Steps to reproduce: 1. Launch Orca master 2. Launch gnome-documents master 3. Preview a document in gnome-documents 4. Tab to the EvView (which Orca master should read automatically) 5. Go back to the gnome-documents overview 6. Repeat steps 3 and 4 for another document Expected results: Orca would present the contents of the displayed page for the currently-previewed document each time. Actual results: At step 6, Orca presents the contents of the last page displayed from the document previewed in step 3. If you go to the next page and back to the previous page, Orca will then present the content of the current document as expected. Digging some into the gnome-documents code, they are reusing the EvView in the previewer, setting the model as needed. But clear_cache() isn't getting called by ev_view_accessible_set_model(). Calling it fixes the bug.
Review of attachment 256400 [details] [review]: This is because the model is set and already contains a document. We were assuming the document is set after ev_view_accessible_set_model(), which is wrong, and we clear the cache in document_changed_cb. At the moment the only thing that document_changed_cb does is clearing the cache, but if we do other initialization there, they should also be done while a new model is set containing a document. So, I think it's better to call document_changed_cb there and checking that the document has actually changed in document_changed_cb to make sure we do nothing in case the model is set without a document. This is exactly what we do in EvView, see ev_view_set_model() and ev_view_document_changed_cb().
Created attachment 256465 [details] [review] proposed patch (In reply to comment #1) > Review of attachment 256400 [details] [review]: > So, I think it's better to call document_changed_cb > there and checking that the document has actually changed in > document_changed_cb to make sure we do nothing in case the model is set without > a document. This is exactly what we do in EvView, see ev_view_set_model() and > ev_view_document_changed_cb(). Done. Thanks for the review!
Review of attachment 256465 [details] [review]: Thanks. Please, push it to master and gnome-3.10 branches
Comment on attachment 256465 [details] [review] proposed patch master: https://git.gnome.org/browse/evince/commit/?id=d194e8a45088c8fb97947eb2199f4db6696c1c7f gnome-3-10: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=3d06f42bcc78b4cf2ff4f903d46798effdff8773