Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PDF viewer failed to refresh pdf after latex recompiling while zoom sharing screen #917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
quarkquartet opened this issue Jan 27, 2022 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@quarkquartet
Copy link

What I'm doing usually: open emacs and eaf to write latex and view pdf. It works pretty well. Every time I change the .tex file and recompile, the eaf buffer refresh the pdf.

But I'm on a zoom meeting today. I'm sharing the screen with others to show my editing and recompling. During zoom meeting, every time I compile the .tex, the eaf buffer crashes with "python crashes unexpectedly". I have to re-open the pdf with eaf. Every time.

I did a test after the meeting. Without zoom, it works pretty good. With zoom sharing screen, it failed to refresh the buffer.
The *eaf* buffer is:

mupdf: bad page number(s)
Failed to watch callback
Traceback (most recent call last):
  File "/Users/isaac/.doom.d/emacs-application-framework/app/pdf-viewer/buffer.py", line 1100, in paintEvent
    qpixmap = self.get_page_pixmap(index, self.scale * hidpi_scale_factor, self.rotation)
  File "/Users/isaac/.doom.d/emacs-application-framework/app/pdf-viewer/buffer.py", line 1021, in get_page_pixmap
    page = self.document[index]
  File "/Users/isaac/.doom.d/emacs-application-framework/app/pdf-viewer/buffer.py", line 475, in __getitem__
    page = PdfPage(self.document[index], index, self.document.isPDF)
  File "/Users/isaac/envs/py386/lib/python3.8/site-packages/fitz/fitz.py", line 5135, in __getitem__
    raise IndexError("page not in document")
IndexError: page not in document

System: MacOS 11.6.
Emacs: emacs-plus@28, Doom Emacs.
Configuration:

(use-package! eaf
  :load-path "~/.doom.d/emacs-application-framework/" ;; I downloaded the eaf package into the .doom.d folder
  :commands (eaf-open)
  :config
  (require 'eaf-pdf-viewer)
  (require 'eaf-markdown-previewer)
  (setq eaf-pdf-dark-mode nil))
(after! latex
  (add-to-list 'TeX-view-program-list '("eaf" eaf-pdf-synctex-forward-view)
            )
(add-to-list 'TeX-view-program-selection '(output-pdf "eaf"))
  )
@MatthewZMD
Copy link
Member

Did it only break in a Zoom meeting? Oh man, the hassle... 😂 EAF has nothing to do with whatever Zoom is doing, I have no idea at a glance what is wrong.

Could you try to reproduce this problem by creating a zoom meeting with only yourself?

@MatthewZMD
Copy link
Member

I just tried and cannot reproduce this problem. Did you re-compile using C-c C-c/M-x TeX-command-master and select LaTeX?

@quarkquartet
Copy link
Author

That's exactly what I did. After that meeting I tried eaf. It is totally fine. Then I open zoom meeting with only myself and shared the screen in that room. The problem happened again......

My reaction to this result is exactly the same as yours.

@quarkquartet
Copy link
Author

I open zoom meeting and share screen, then C-c C-a. After the compiling, it says "EAF detected the change in pdf, refreshing buffer", as expected. Then the eaf buffer crashes. Python crashes with system report.

Maybe I should restart the computer and try it again. Let me do that.

@MatthewZMD
Copy link
Member

Did you make changes to the LaTeX document that affected the total page number? Or any simple change would do it?

@quarkquartet
Copy link
Author

Did you make changes to the LaTeX document that affected the total page number? Or any simple change would do it?

Any simple change would do it.

Actually, the crash would happen while changing the page number when I use eaf half a year ago. But after you updated it, this did not happen anymore.

@quarkquartet
Copy link
Author

quarkquartet commented Jan 27, 2022

Did you make changes to the LaTeX document that affected the total page number? Or any simple change would do it?

OK I restarted my laptop and retest it. The result is the following:

  • If I do small changes, crashes happen randomly when I open zoom. Without zoom this wont happen.
  • When I try to delete or add many stuffs that may suddenly change the page number by more than 1, crash must happen regardless of the zoom status.

The content in *eaf* is the same as above if crash happens.

Is the "crash may happen if page number is changing" a known bug?

@MatthewZMD
Copy link
Member

Is the "crash may happen if page number is changing" a known bug?

It was, but fixed awhile ago. It is what I inferred from the mupdf: bad page number(s) error message.

@MatthewZMD
Copy link
Member

  • When I try to delete or add many stuffs that may suddenly change the page number by more than 1, crash must happen regardless of the zoom status.

So what you mean is if you add stuff that incremented the page number, this error occurs all the time?

@quarkquartet
Copy link
Author

I think it

  • When I try to delete or add many stuffs that may suddenly change the page number by more than 1, crash must happen regardless of the zoom status.

So what you mean is if you add stuff that incremented the page number, this error occurs all the time?

Yes very strange. That's what I tried.

But I restarted many times and did many test after replying here. The current status is that:

  • Small change only causes crash on zoom. It happens randomly, not all the time.
  • Large change with changing the page number causes crash regardless of zoom, but not necessarily happen.

I would bet things could change if I restart my laptop again......But for now you can regard it simply as a problem about stability.

manateelazycat added a commit that referenced this issue Feb 8, 2022
@manateelazycat
Copy link
Member

manateelazycat commented Feb 8, 2022

28d0019 fix for issue #916

@manateelazycat
Copy link
Member

@quarkquartet According to my past experience, I guess Zoom will snatch "input focus" of system, then something wrong when EAF or Emacs lost "input focus".

Just me guess, I don't know whether can help you. ;)

@manateelazycat manateelazycat added the help wanted Extra attention is needed label Feb 12, 2022
@manateelazycat
Copy link
Member

@quarkquartet Sorry, don't know reason, please re-open this issue if you have any clue.

Thanks for report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants