Skip to content
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

Scrolling on mac has high delay #122

Open
AndyDekiert opened this issue Oct 18, 2024 · 13 comments
Open

Scrolling on mac has high delay #122

AndyDekiert opened this issue Oct 18, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@AndyDekiert
Copy link

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.

@willipreuk
Copy link

Adding to this: using the arrow keys or the scroll bar works without lag.

@PHPirates
Copy link
Collaborator

PHPirates commented Oct 21, 2024

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.

@PHPirates PHPirates added the bug Something isn't working label Oct 21, 2024
@willipreuk
Copy link

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.

@AndyDekiert
Copy link
Author

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.

@AndyDekiert
Copy link
Author

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.

@PHPirates
Copy link
Collaborator

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.

@AndyDekiert
Copy link
Author

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.

@PHPirates PHPirates pinned this issue Nov 7, 2024
@PHPirates
Copy link
Collaborator

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.

@PHPirates PHPirates changed the title [BUG] Scrolling on mac has high delay Scrolling on mac has high delay Nov 7, 2024
@janoschp
Copy link

janoschp commented Feb 4, 2025

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.

@ThomasWagner-dev
Copy link

ThomasWagner-dev commented Feb 19, 2025

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)

@Him188
Copy link

Him188 commented Feb 19, 2025

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 :)

@PHPirates
Copy link
Collaborator

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 #122 (comment) says the issue is also there

@PHPirates
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants
@janoschp @Him188 @PHPirates @willipreuk @AndyDekiert @ThomasWagner-dev and others