Scrolling on mac has high delay
With Version 0.17.0, IntelliJ Idea 2024.2.3 and macOS 14.6.1, the scrolling of the PDF with the built-in touchpad is extremely slow and has a delay. When trying to scroll more than a couple of lines, the PDF viewer is still receiving and handling input seconds after the input stopped. The viewer may even change the direction of the scrolling after the input has stopped. So it is not like the viewer continues to scroll slowly but is actually still handling the queued input events.
Scrolling in all other windows and the editor of IntelliJ works as expected, only the PDF viewer is affected.
Adding to this: using the arrow keys or the scroll bar works without lag.
Thanks for reporting this, we had this problem in the past (#51) but apparently it has come back. I don't have a Mac to test this with, so this may take a while to fix.
We are not listening directly for scroll wheel events anymore (causing slow callbacks), but possibly other events are causing this. Could you try these versions? intellij-pdf-viewer-0.17.1-alpha.1.1.zip intellij-pdf-viewer-0.17.1-alpha.1.2.zip intellij-pdf-viewer-0.17.1-alpha.1.3.zip
Is the problem also there if you right-click the pdf and select 'open in embedded browser'? If you do not see a context menu, it may help to go to Help > Find Action, search for Registry, set pdf.viewer.use.jcef.osr.view to false, and restart. See IJPL-59459 for more details.
Hey, thank you for your effort! I have tried the alpha versions and sadly saw no improvement, the issue is also present in the embedded browser view.
Hey, I am sorry for the late response. Unfortunately I can confirm @willipreuk result's with the three alpha versions and the embedded browser view.
I just installed version 0.16.0 from the GitHub releases page and it is working fine. So, the issue must be related to some of the changes between 0.16.0 and 0.17.0.
Thanks for testing! Interesting, so if it's also there in the embedded pdfium it may be something on the plugin side. Unfortunately so many things changed between 0.16 and 0.17 it will be hard to do a bisection, in particular because as said I don't have an iOS to test with.
We can still run a profiler to see where the issue is. For the browser part,
- Search (double shift) for Registry, and enable
pdf.viewer.debug(you can search here) - right-click on the pdf and open devtools, or search (double shift) for "Open DevTools"
- Go to the performance tab
- Start a recording
- Reproduce the performance issue
- Stop the recording
- Click 'save profile' - at least in theory, because for me this button does not work at the moment
For the backend, with a jvm profiler:
- Install VisualVM using your package manager or go to https://visualvm.github.io/
- Start IntelliJ
- Start VisualVM.
- In the Applications panel on the left, identify the correct instance of IntelliJ
- Go to the Sampler tab.
- Click CPU to start profiling
- Reproduce the performance issue
- Stop the profiling
- Take a Snapshot to view and save results.
- Now you can zip the nps file and upload it here on GitHub.
Hey, sorry for the late reply. I did the first part - the save profile button works for me. Trace-20241103T124221.json
Please let me know if the information is helpful and if the second part is required.
Thanks a lot! I don't see very strange things at first sight, but I will take a closer look later on.
I think the issue has nothing to do with the backend of the plugin, so profiling the Kotlin code probably won't be very useful.
Any progress? Which older version doesn't have this problem? I would like to try to downgrade.
Edit: should have read the other comments đŸ˜… installing 0.16 solves the issue. The scrolling issue in 0.17 is unbearably annoying.
Thanks for reporting this, we had this problem in the past (#51) but apparently it has come back. I don't have a Mac to test this with, so this may take a while to fix.
We are not listening directly for scroll wheel events anymore (causing slow callbacks), but possibly other events are causing this. Could you try these versions? intellij-pdf-viewer-0.17.1-alpha.1.1.zip intellij-pdf-viewer-0.17.1-alpha.1.2.zip intellij-pdf-viewer-0.17.1-alpha.1.3.zip
Is the problem also there if you right-click the pdf and select 'open in embedded browser'? If you do not see a context menu, it may help to go to Help > Find Action, search for Registry, set pdf.viewer.use.jcef.osr.view to false, and restart. See IJPL-59459 for more details.
The registry change worked for me on the newest IntelliJ Version on a Macbook Pro M1, thanks. (IntelliJ 2024.3.3 and PDF Virwer 0.17)
If finding the root cause is hard, it's worth reverting all changes and release a 0.17.1 or 0.18.0 that is exactly the same as 0.16.0.
This bug is preventing mac users from using the plugin. My colleagues and I all agree that 0.17.0 is not useable (on macs), and I had to teach them how to install an old version. IDEs upgrade every a few weeks and it automatically updates plugins to the newest version, so we also had to frequently install the 0.16.0 version. The added featuers in 0.17.0 actually do not matter that much, and we are also unable to use them because 0.17.0 breaks the essential scrolling feature.
So I'm just honestly suggesting that we revert all changes back to a usable state :)
The registry change worked for me on the newest IntelliJ Version on a Macbook Pro M1, thanks. (IntelliJ 2024.3.3 and PDF Virwer 0.17)
@ThomasWagner-dev Do you mean the issue is not present when using the embedded browser? Because this comment https://github.com/FirstTimeInForever/intellij-pdf-viewer/issues/122#issuecomment-2431571012 says the issue is also there
@Him188 I understand, but we can't support the older pdfjs version forever, and I will be moving forward with improvements based on the current situation since this issue only affects Mac users. I'm not saying that this issue is difficult to solve, just that it is difficult to solve without a Mac available to test it on, so I still have hope that someone with a Mac can help you Mac users with this. I can only do some blind guesses.
Yeah just wanted to add, running a Mac on Sequoia 15.4 and I am also getting the scrolling issues. Weirdly enough, the issue seems to only be unusable when I use the touchpad to scroll, but using my mouse it seems fine (for me at least).
Let me know if I can help.
@loicduchesne just downgrade to 0.16, there doesn't seem to be a fix in sight.
@loicduchesne just downgrade to 0.16, there doesn't seem to be a fix in sight.
Is the registry fix not working for you?
@loicduchesne just downgrade to 0.16, there doesn't seem to be a fix in sight.
Is the registry fix not working for you?
The "registry fix" only makes the "Open in Embedded Browser" context menu visible for me. The scrolling issue persists.
And using the embedded browser is no option for you?
It's just a workaround.
I currently resort to keyboard navigation, as the combo of quickly switching between the pdf and LaTeX code + working keyboard navigation is more important to me than the touchpad scrolling.
And downgrading is also not really a permanent fix as you have to do it every couple of days/weeks if the IDE is set to auto update (the other) plugins.
Yes, I would recommend using 0.16.1 for now and I don't see any way to disable updates for a single plugin, assuming you are talking about File > Appearance & Behavior > System Settings > Updates > Update plugins automatically
It would be helpful if someone could help bisecting the issue:
intellij-pdf-viewer-0.16.1-70881dbc-30-8-12-48.zip
intellij-pdf-viewer-0.16.1-4aa43f17-14-9-12-28.zip
intellij-pdf-viewer-0.16.1-73cb4bdc-18-9-8-54.zip
intellij-pdf-viewer-0.16.1-7d25164e-23-9-1-28.zip
i
Hey, thank you for looking into this even without owning a mac. The first two do not have the issue, the last two do.
Thanks! That means the problem was introduced in #114, the pdfjs update.
Let's try to narrow it down a bit more:
intellij-pdf-viewer-0.16.1-9-13-8-32-699c1263.zip
intellij-pdf-viewer-0.16.1-9-13-9-2-b4759110.zip
intellij-pdf-viewer-0.16.1-9-13-9-40-e8cbd925.zip
intellij-pdf-viewer-0.16.1-9-13-12-37-9343f92f.zip
intellij-pdf-viewer-0.16.1-9-13-14-22-9ab3433f.zip
The first gives this error: "Error: The API version "4.10.38" does not match the Viewer version "4.6.82".", The second one works, The third one works, The fourth one has the problem,
The fifth one works but the sidebar looks funky,
Thanks! Then it must have been one of these commits, and lets double check the fifth one if I compiled it correctly:
intellij-pdf-viewer-0.16.1-10-34-c20bb229.zip I expect this one to work
intellij-pdf-viewer-0.16.1-14-22-9ab3433f.zip This one should have the problem
If that is all true, the problem was introduced in commit 9343f92f, updating from pdfjs 2.16.105 to 3.11.174
That makes me wonder if this one works:
The first one does work, the second one still has the console error, and the third has the problem
Just to add another data point—the embedded browser has the same issue for me; however, setting pdf.viewer.use.jcef.osr.view to false resolved the issue. I'm running IntelliJ Ultimate 2024.3.1.1, PDF Viewer 0.17.0.
Just to add another data point—the embedded browser has the same issue for me; however, setting
pdf.viewer.use.jcef.osr.viewto false resolved the issue. I'm running IntelliJ Ultimate 2024.3.1.1, PDF Viewer 0.17.0.
How to set pdf.viewer.use.jcef.osr.view in PDF Viewer 0.17.0, I couldn't find that setting.
It's in the registry as mentioned in the above comment:
Is the problem also there if you right-click the pdf and select 'open in embedded browser'? If you do not see a context menu, it may help to go to Help > Find Action, search for Registry, set pdf.viewer.use.jcef.osr.view to false, and restart. See IJPL-59459 for more details.
https://github.com/FirstTimeInForever/intellij-pdf-viewer/issues/122#issuecomment-2425842610
Hello, do you have any solution to fix that lag ?
Issue reappears in macOS 26 on PyCharm, even with the pdf.viewer.use.jcef.osr.view in the registry set to false.