doki-theme / doki-theme-jetbrains

Cute anime character themes for your JetBrains IDEs.
MIT License
647 stars 40 forks source link

[BUG] Not compatible with SVG disk cache #483

Closed NekoCaffeine closed 2 years ago

NekoCaffeine commented 2 years ago

Describe the bug

IDEA does not start properly, i.e. none of the UI components can be initialised.

To Reproduce

  1. IntelliJ IDEA instances with DDLC enabled
  2. Upgrade to 2022.1 EAP (#IC-221.3427.29)
  3. Launch IntelliJ IDEA

Expected Behavior

Normal start-up

Workground Add the following virtual machine parameters to disable SVG disk caching. -Didea.ui.icons.svg.disk.cache=false see also: https://github.com/JetBrains/intellij-community/blob/143056988414ec20b93fd73840284ad04d367e6d/platform/util/ui/src/com/intellij/util/SVGLoader.java#L47

Environment

IntelliJ IDEA 2022.1 EAP (Community Edition)
Build #IC-221.3427.89, built on January 27, 2022
Runtime version: 17+35-LTS amd64
VM: OpenJDK 64-Bit Server VM by SAP SE
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 8192M
Cores: 32
Non-Bundled Plugins:
    io.acari.DDLCTheme (22.0.2)
    amadeus.maho (221.3427.89)

Kotlin: 221-1.5.10-release-958-IJ3427.89

Screenshots

image Stuck in the splash UI.

Stack traces

java.lang.NullPointerException: Parameter specified as non-null is null: method com.intellij.ui.svg.SvgDocumentFactoryKt.createSvgDocument, parameter data
        at com.intellij.ui.svg.SvgDocumentFactoryKt.createSvgDocument(SvgDocumentFactory.kt)
        at com.intellij.util.SVGLoader.createDocument(SVGLoader.java:339)
        at com.intellij.util.SVGLoader.loadAndCache(SVGLoader.java:243)
        at com.intellij.util.SVGLoader.load(SVGLoader.java:232)
        at com.intellij.util.SVGLoader.load(SVGLoader.java:111)
        at com.intellij.ui.SpinningProgressIcon.getIconFromCache(SpinningProgressIcon.kt:75)
        at com.intellij.ui.SpinningProgressIcon.access$getIconFromCache(SpinningProgressIcon.kt:26)
        at com.intellij.ui.SpinningProgressIcon$CashedDelegateIcon.getDelegate(SpinningProgressIcon.kt:61)
        at com.intellij.ui.SpinningProgressIcon$CashedDelegateIcon.getIconWidth(SpinningProgressIcon.kt:63)
        at com.intellij.util.ui.EmptyIcon.create(EmptyIcon.java:62)
        at com.intellij.util.ui.AnimatedIcon.<init>(AnimatedIcon.java:50)
        at com.intellij.util.ui.AsyncProcessIcon.<init>(AsyncProcessIcon.java:37)
        at com.intellij.util.ui.AsyncProcessIcon.<init>(AsyncProcessIcon.java:33)
        at com.intellij.idea.ApplicationLoader$prepareStart$4$5.run(ApplicationLoader.kt:248)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

Related Codes https://github.com/doki-theme/doki-theme-jetbrains/blob/master/src/main/kotlin/io/unthrottled/doki/icon/ColorPatcher.kt#L47

https://github.com/JetBrains/intellij-community/blob/143056988414ec20b93fd73840284ad04d367e6d/platform/util/ui/src/com/intellij/util/SVGLoader.java#L210 https://github.com/JetBrains/intellij-community/blob/143056988414ec20b93fd73840284ad04d367e6d/platform/util/ui/src/com/intellij/util/SVGLoader.java#L215

https://github.com/JetBrains/intellij-community/blob/143056988414ec20b93fd73840284ad04d367e6d/platform/util/ui/src/com/intellij/util/SVGLoader.java#L243 https://github.com/JetBrains/intellij-community/blob/143056988414ec20b93fd73840284ad04d367e6d/platform/util/ui/src/com/intellij/ui/svg/SvgDocumentFactory.kt#L26

Unthrottled commented 2 years ago

Ah, yup, this thing.

You jumped on the 2022.1 train faster than I could get a release out (that one is my fault).

I've got fixes, I'm just also bundling it with a new release. You can use this pre-release https://github.com/doki-theme/doki-theme-jetbrains/releases/tag/v74.0-1.0.0-BETA.0 I've got everything taken care of (I think), just working on finishing touches.

NekoCaffeine commented 2 years ago

The new version is great!

Unthrottled commented 2 years ago

Just as a heads up, I actually didn't fix the problem, if you ever switch themes, it will keep the old themed icons. I assume that you are running your intellij with -Didea.ui.icons.svg.disk.cache=false so it isn't a problem for you at the moment. However, in the up coming release, I'll have the proper caching fix implemented.