asciidoctor / asciidoctor-intellij-plugin

AsciiDoc plugin for products on the IntelliJ platform (IDEA, RubyMine, etc)
https://intellij-asciidoc-plugin.ahus1.de/
Apache License 2.0
347 stars 146 forks source link

Preview sometimes disappears on macOS #1356

Closed ascheman closed 1 year ago

ascheman commented 1 year ago

Observed vs. expected behavior

Moving the mouse to one of the sidebars makes the preview disappear as shown in the attached video

Steps to reproduce

Cf. video

Environment

Plugin Version: 0.38.14

IntelliJ Details: Build #IU-231.8770.65, built on April 27, 2023

ascheman commented 1 year ago

This only seems to happen when I place IntelliJ on the built-in display of my MacBook. If I have multiple projects (project windows) open, it occurs as soon as i move one of the windows the built-in display.

jtiee commented 1 year ago

I see the same problem when adjusting image macros in the Asciidoc source. Occasionally, the preview disappears while typing regular content. Dragging the divider between the editor and preview panes causes the preview to re-render.

jtiee commented 1 year ago

Another cause: when I change an inline image to a block image (adding a colon), the path picker appears and the preview goes blank.

ahus1 commented 1 year ago

Some people reported rendering problems with off-screen-rendering, see for example IDEA-243056.

Could you try to apply the setting ide.browser.jcef.gpu.disable=true as described in the issue above, and see if this changes something for you?

Another idea: Look for JavaScript errors in the preview. Proceed as follows:

  1. Use "Help | Find Action..." and search for action "Open Devtools Window for the current AsciiDoc preview".
  2. Switch to the "Console"
  3. Reproduce the problem
  4. See if errors occurred in the Console

Note When closing the Devtools, the IDE will close as well unless you've chosen to promt a confirmation dialog on closing the IDE - this is a known bug. See JCEF preview in the docs for more details.

jtiee commented 1 year ago

Setting ide.browser.jcef.gpu.disable=true in the IntelliJ Registry does not change the problematic behavior. The preview continues to disappear in all of the described scenarios.

There are no errors in the DevTools Console when the preview disappears or re-appears.

If it matters, I'm running IntelliJ 2023.1.2 (Build #IU-231.9011.34, built on May 15, 2023) on macOS Ventura 13.3.1 (a), Asciidoc Plugin 0.38.13.

Because it took more than 5 minutes to find out how, for anyone following along, press Command+Option+Shift+/ (macOS) or Control-Alt-Shift+/ (Windows), then select Registry..., then scroll to the registry entry and toggle its checkbox.

ascheman commented 1 year ago

Thanks for the hint to open the registry, @jtiee!

Meanwhile I have upgraded to 2023.1.2 as well and still see the problem as described by Ewan.

jtiee commented 1 year ago

I've tried versions of the plugin back to 0.38.10, and the issue persists. However, the problem began when I upgraded to IntelliJ 2023.1.2. The preview did not blank with IntelliJ 2023.1.1, so this is likely a problem in the IDE and not the plugin.

FYI: 2023.1.2 fixes a problem with adding project dictionaries I need when authoring Antora content.

ahus1 commented 1 year ago

@jtiee - thanks for your extensive investigation. I search the JetBrains tracker: https://youtrack.jetbrains.com/issue/IDEA-320089/JCEF-Browser-disappears-unexpectedly-on-unfocus - does that sound similar?

Version 2023.2 is already available as an EAP, so I'd be happy if you would give it a try.

If not, there's also the registry option ide.browser.jcef.asciidocView.osr.enabled where you can disable the off screen rendering which is by default enabled.

jtiee commented 1 year ago

Yes, IDEA-320089 sounds like the same issue. I didn't find it myself because I'm unfamiliar with IDEA terminology.

I've just fired up 2023.2 EAP, and the blanking appears to be fixed! None of the described triggers blank the preview anymore. I've only used it for ~10 minutes so far. I'll report back if any issues come up after further use.

@ascheman Does 2023.2 EAP solve the issue for you? If so, we can likely close this issue.

ahus1 commented 1 year ago

I've moved the discussion about RDP to a new issue: #1371

ahus1 commented 1 year ago

It has been two weeks - assuming this is fixed with the latest release I'm closing this issue.