Skip to content

Conversation

@guusdk
Copy link
Member

@guusdk guusdk commented Oct 10, 2025

The current Spark system tray integration relies on java.awt.SystemTray and TrayIcon, which exhibit inconsistent behavior across platforms—particularly on Linux distributions using GNOME or Wayland—resulting in missing icons, limited menu support, and unreliable tooltip rendering.

To improve cross-platform stability and user experience, we will migrate to the Dorkbox SystemTray library (com.dorkbox.SystemTray). This library provides:

  • Broader platform support (Windows, macOS, Linux with AppIndicator, GtkStatusIcon, and Swing fallbacks)
  • Auto-detection and fallback handling for modern desktop environments
  • Enhanced menu options (Swing and native)
  • Better icon scaling and DPI handling
  • Configurable shutdown hooks and improved tray cleanup

Benefits:

  • Reliable tray visibility on Linux (GNOME, Ubuntu, etc.)
  • Consistent icon and tooltip behavior across all supported OSes
  • Richer tray menu customization options

The current Spark system tray integration relies on java.awt.SystemTray and TrayIcon, which exhibit inconsistent behavior across platforms—particularly on Linux distributions using GNOME or Wayland—resulting in missing icons, limited menu support, and unreliable tooltip rendering.

To improve cross-platform stability and user experience, we will migrate to the Dorkbox SystemTray library (com.dorkbox.SystemTray). This library provides:

- Broader platform support (Windows, macOS, Linux with AppIndicator, GtkStatusIcon, and Swing fallbacks)
- Auto-detection and fallback handling for modern desktop environments
- Enhanced menu options (Swing and native)
- Better icon scaling and DPI handling
- Configurable shutdown hooks and improved tray cleanup

Benefits:
- Reliable tray visibility on Linux (GNOME, Ubuntu, etc.)
- Consistent icon and tooltip behavior across all supported OSes
- Richer tray menu customization options
@stokito
Copy link
Contributor

stokito commented Oct 10, 2025

When staring from IDE the exception occured:

SEVERE: An exception occurred while initializing plugin org.jivesoftware.sparkimpl.plugin.systray.SysTrayPlugin@44ce7d60
kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath
	at kotlin.jvm.internal.ClassReference.error(ClassReference.kt:79)
	at kotlin.jvm.internal.ClassReference.getQualifiedName(ClassReference.kt:15)
	at dorkbox.updates.Updates.<clinit>(Updates.kt:25)
	at dorkbox.os.OS.<clinit>(OS.kt:34)
	at dorkbox.systemTray.SystemTray.<clinit>(SystemTray.java:101)
	at org.jivesoftware.sparkimpl.plugin.systray.SysTrayPlugin.initialize(SysTrayPlugin.java:89)
	at org.jivesoftware.spark.PluginManager.lambda$initializePlugins$1(PluginManager.java:769)

Maybe I need to fix something on my side but I was surprised to see the kotlin-stdlib. I checked all dependencies:

\- com.dorkbox:SystemTray:jar:4.4:provided
     +- com.dorkbox:Collections:jar:2.4:provided
     +- com.dorkbox:Executor:jar:3.13:provided
     |  +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.8.0:provided
     |  |  +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.8.0:provided
     |  |  \- org.jetbrains:annotations:jar:13.0:provided
     |  \- org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:jar:1.7.1:provided
     +- com.dorkbox:Desktop:jar:1.1:provided
     +- com.dorkbox:JNA:jar:1.2:provided
     +- com.dorkbox:OS:jar:1.8:provided
     +- com.dorkbox:Updates:jar:1.1:provided
     +- com.dorkbox:Utilities:jar:1.46:provided
     |  +- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:jar:1.7.3:provided
     |  \- com.fasterxml.uuid:java-uuid-generator:jar:4.2.0:provided
     +- org.javassist:javassist:jar:3.29.2-GA:provided
     +- net.java.dev.jna:jna-jpms:jar:5.13.0:provided
     +- net.java.dev.jna:jna-platform-jpms:jar:5.13.0:provided
     \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.8.0:provided
        \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.8.0:provided

Looks like too many dependencies.

The tray looks working for me on Windows 8, Ubuntu Mate, Ubuntu GNOME Flashback. Maybe the change is not so critical.

@guusdk
Copy link
Member Author

guusdk commented Oct 10, 2025

That dependency seems to be non-optional (at least in Dorkbox 4.4). I've created an issue for that in dorkbox/SystemTray#229 .

Even when providing that dependency in Spark, Dorkbox seems to hang indefinitely, at least on my Ubuntu environment. There are various other issues in their GitHub project that seem related - some of which suggest that the problem is fixed in unreleased code.

For now, lets hold off on merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants