GNOME Bugzilla – Bug 357472
Open/View a Copy of current document
Last modified: 2009-07-07 14:57:10 UTC
Occasionally when working with large documents you frequently revisit the same page after some reading. Jumping arround by remembering page numbers is quite inconvenient. I good improvement would be some kind of bookmark system - which is worked on, as I hear. But in a multi-head setup it might be preferable to open multiple views of the same document: On one screen you hold your reference page on the other screen you jump arround in the document and read. Unfortunatly this workflow is not supported by Evince yet due its spatial model of operation. A quite workarround for this issue would be adding some "Open a Copy" entry to the file menu - right over the "Save a Copy" entry. This entry would create a symlink of the current file located in the /tmp folder, instruct the shell to show this file (without polluting the recent files list). As soon as the new view is created the symlink would be removed again. This should work as it appears like Evince keeps a file descriptor for this file it currently views and would have the advantage of minimal code alteration. But maybe there are better solutions for this operation. What are the chances to get this feature into Epiphany. Once an implementation model is choosen I'd take the burden to create the patch. Other information:
Adding CC as suggested by Nickolay: "add bclark@redhat.com to cc probably bryan will suggest something else"
Yes, for my opinion it's a reasonable request.
I've just committed to cvs head a fix for this issue. Thanks for the so useful report.
@Carlos: Thanks for taking care, but reopening the bug as I found two issues in your implementation: 1) You forgot to increment "i", so if the file exists you get an infinite loop. 2) The patch introduces a classic race-condition: The file not existing, when g_file_test is invoked by ev_window_get_copy_tmp_name might show up, until the symlink really is created. Working on a patch right now.
Created attachment 76605 [details] [review] The patch promised. Here you find the promised patch: - incrementing i during the file-existance loop - avoiding the race condition by intermediatly creating the symlink and checking for file existance by inspecting the error code - avoid creating a malloced copy for the error message Btw: Why did you create a copy of msg before passing it to ev_window_error_dialog? A static copy of that string should be sufficient. Also changed that.
And if someone'll create dogtail script for tests it would be just amazing
oh! sorry :-( I didn't test it enough. Mathias, thanks a lot, your patch looks good to me.
(In reply to comment #5) > Btw: Why did you create a copy of msg before passing it to > ev_window_error_dialog? A static copy of that string should be sufficient. Also > changed that. > hehe, because I'm stupid :-D The msg was going to be something like: "Cannot open a copy of file %s", but then I realized that it was going to be redundant and I removed the %s. Just another thing before you commit it, I've just added a ev_tmp_dir() function so that all temp files will be created in the same directory under /tmp. So, please use ev_tmp_dir() instead of g_get_tmp_dir(). Thanks again :-)
(In reply to comment #8) > Just another thing before you commit it, ... Just in case "you" refers to me: I never tried to acquire write permissions for GNOME CVS...
oh! then I'll apply it.
I've just committed a slightly modified version of the patch.
*** Bug 413427 has been marked as a duplicate of this bug. ***
*** Bug 587940 has been marked as a duplicate of this bug. ***