weisJ / auto-dark-mode

IDEA plugin to automatically apply system theme settings on macOS and Windows.
https://plugins.jetbrains.com/plugin/14076-auto-dark-mode
MIT License
53 stars 14 forks source link

Opening 'Device Manager' panel causes an ide error in intellij 2024.2 #89

Open unaaagy opened 2 months ago

unaaagy commented 2 months ago

https://github.com/user-attachments/assets/21bbe8af-bcc5-4173-b0b9-23a23835225b

Here's the error:

java.lang.Throwable: com.github.weisj.darkmode.IntellijNotificationService <clinit> requests com.intellij.notification.NotificationGroupManager instance. Class initialization must not depend on services. Consider using instance of the service on-demand instead.
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
    at com.intellij.serviceContainer.ComponentManagerImplKt.checkOutsideClassInitializer(ComponentManagerImpl.kt:1588)
    at com.intellij.serviceContainer.ComponentManagerImplKt.getOrCreateInstanceBlocking(ComponentManagerImpl.kt:1557)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:746)
    at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:690)
    at com.intellij.notification.NotificationGroupManager.getInstance(NotificationGroupManager.java:19)
    at com.github.weisj.darkmode.IntellijNotificationService.<clinit>(IntellijNotificationService.kt:54)
    at com.github.weisj.darkmode.AutoDarkModeStartupListener.appFrameCreated(AutoDarkModeStartupListener.kt:32)
    at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:722)
    at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:686)
    at com.intellij.util.messages.impl.MessageBusImplKt.deliverMessage(MessageBusImpl.kt:445)
    at com.intellij.util.messages.impl.MessageBusImplKt.pumpWaiting(MessageBusImpl.kt:424)
    at com.intellij.util.messages.impl.MessageBusImplKt.access$pumpWaiting(MessageBusImpl.kt:1)
    at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:483)
    at jdk.proxy2/jdk.proxy2.$Proxy59.appFrameCreated(Unknown Source)
    at com.intellij.idea.IdeStarter$openProjectIfNeeded$isOpenProjectNeeded$1$1.invokeSuspend(IdeStarter.kt:121)
    at com.intellij.idea.IdeStarter$openProjectIfNeeded$isOpenProjectNeeded$1$1.invoke(IdeStarter.kt)
    at com.intellij.idea.IdeStarter$openProjectIfNeeded$isOpenProjectNeeded$1$1.invoke(IdeStarter.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:56)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49)
    at com.intellij.idea.IdeStarter$openProjectIfNeeded$isOpenProjectNeeded$1.invokeSuspend(IdeStarter.kt:119)
    at com.intellij.idea.IdeStarter$openProjectIfNeeded$isOpenProjectNeeded$1.invoke(IdeStarter.kt)
    at com.intellij.idea.IdeStarter$openProjectIfNeeded$isOpenProjectNeeded$1.invoke(IdeStarter.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:56)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49)
    at com.intellij.idea.IdeStarter.openProjectIfNeeded$suspendImpl(IdeStarter.kt:118)
    at com.intellij.idea.IdeStarter.openProjectIfNeeded(IdeStarter.kt)
    at com.intellij.idea.IdeStarter$start$2$openProjectBlock$1.invokeSuspend(IdeStarter.kt:82)
    at com.intellij.idea.IdeStarter$start$2$openProjectBlock$1.invoke(IdeStarter.kt)
    at com.intellij.idea.IdeStarter$start$2$openProjectBlock$1.invoke(IdeStarter.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.intellij.idea.IdeStarter$start$2.invokeSuspend(IdeStarter.kt:92)
    at com.intellij.idea.IdeStarter$start$2.invoke(IdeStarter.kt)
    at com.intellij.idea.IdeStarter$start$2.invoke(IdeStarter.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
    at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:261)
    at com.intellij.idea.IdeStarter.start$suspendImpl(IdeStarter.kt:67)
    at com.intellij.idea.IdeStarter.start(IdeStarter.kt)
    at com.intellij.platform.ide.bootstrap.ApplicationLoader$executeApplicationStarter$2.invokeSuspend(ApplicationLoader.kt:385)
    at com.intellij.platform.ide.bootstrap.ApplicationLoader$executeApplicationStarter$2.invoke(ApplicationLoader.kt)
    at com.intellij.platform.ide.bootstrap.ApplicationLoader$executeApplicationStarter$2.invoke(ApplicationLoader.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:56)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49)
    at com.intellij.platform.ide.bootstrap.ApplicationLoader.executeApplicationStarter(ApplicationLoader.kt:384)
    at com.intellij.platform.ide.bootstrap.StartupUtil$startApplication$9.invokeSuspend(startup.kt:326)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
weisJ commented 2 months ago

Just released a pre-release version that might fix the issue: https://plugins.jetbrains.com/plugin/14076-auto-dark-mode/versions/pre-release/590327?noRedirect=true