Bug 79034 - Watch file, delay too short
Summary: Watch file, delay too short
Status: RESOLVED NOT A BUG
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 74339 84829 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-04 11:32 UTC by Frederik Holljen
Modified: 2014-05-08 08:30 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederik Holljen 2004-04-04 11:32:51 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Compiled From Sources

I'm watching a pdf file that I generate with several calls to pdflatex. The problem is that KGhostview sometimes decides to refresh while one of the pdflatex are still working. This completely messes up KGhostView (displays same page for all pages, previews blank, further updates to the file are not detected), most probably because the data it reads from the pdf is not valid.

Is it possible to add a (longer?) delay to the refresh or maybe check that the file is not being written to before refreshing?
Comment 1 Jens 2004-04-06 14:43:10 UTC
Yes, I voted for this some time ago. KGhostview should check if the file is still being created and not call gs on the file as long.

I would also really like kghostview if it didn't show up multiple "cannot open file" windows while pdflatex is still running, but at most one. Or perhaps a flashing statusbar for a couple seconds, or a warning in the main document window, or something.

Otherwise creating and viewing bigger projects (my diploma thesis takes about 30 seconds for pdflatex to render, on a P4-1800MHz, due to many PNG and PDF images) is made impractical because you have to keep re-opening the file.


Thank you!

Jens
Comment 2 Jens 2004-04-06 14:43:59 UTC
Oh yes: see also Bug 74339.
Comment 3 Luís Pedro Coelho 2004-04-11 01:08:14 UTC
*** Bug 74339 has been marked as a duplicate of this bug. ***
Comment 4 Luís Pedro Coelho 2004-09-13 12:34:17 UTC
*** Bug 84829 has been marked as a duplicate of this bug. ***
Comment 5 Jens 2004-10-28 09:57:26 UTC
Hi,

this bug is still in 3.3.1, which I upgraded to exactly because I needed this fixed. I use Kile / PDFLatex very heavily and this bug just annoys the hell out of me :-(

Also, PDFlatex often crashed after having closed 3-4 of these "Cannot open file" windows, or the mouse cursor stayed in "please wait" mode, and KGhostview became unresponsive. This especially happened when using it as a Konqueror plugin, not standalone.

One workaround would be to keep the page and orientataion when using "File->Open recent", or to offer a "Reopen file" (preferably with hotkey Ctrl-R, "F5" or something) which will KEEP the current position (ie. page and view position) in the PDF file.

One other suggestion: just keep calling the Qt equivalent of "fuser -n $PDF_FILE" (or something with "lsof", list open files) when you notice the PDF file has changed, until no application uses it any more.


THANK you! :-)
Free pizza for whoever fixes this bug (or a dinner invitation for anybody from Hamburg :-)
Comment 6 Jens 2005-05-25 16:06:56 UTC
Hello, this bug is still in KDE 3.4.0, and it is related at least to 
Bug 55653 and Bug 103480. Kghostview just crashed on me again (using pdflatex to write a PDF file). KPDF does the same.

I would guess that the only real way to close this bug is to enable Kghostview / KPDF to check the file integrity _before_ trying to load it. I.e. check if the PDF / Postscript file is not corrupt. I don't know if searching for an "%%EOF" marker at the end of the file will do the trick, but this might avoid waiting for a fixed time (after all, loading a corrupt PDF or Postscript file can happen all the time, not just during re-creation by e.g. pdflatex).

Jens
Comment 7 Adrián Chaves (Gallaecio) 2012-10-16 05:34:08 UTC
Can you confirm whether or not this happens with Okular?
Comment 8 Albert Astals Cid 2014-05-08 08:30:05 UTC
No answer for years.