From 43c6c73ce324c51d21874684a3c828e8530177b8 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 23 Oct 2018 15:46:22 +0200 Subject: [PATCH] Fixed error with ubuntu 17.10 loading the tray icon --- src/dorkbox/systemTray/ui/gtk/_AppIndicatorNativeTray.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dorkbox/systemTray/ui/gtk/_AppIndicatorNativeTray.java b/src/dorkbox/systemTray/ui/gtk/_AppIndicatorNativeTray.java index 896975f..b82a08c 100644 --- a/src/dorkbox/systemTray/ui/gtk/_AppIndicatorNativeTray.java +++ b/src/dorkbox/systemTray/ui/gtk/_AppIndicatorNativeTray.java @@ -223,10 +223,12 @@ class _AppIndicatorNativeTray extends Tray { @Override public void run() { - String id = System.nanoTime() + "DBST"; + String id = "DBST" + System.nanoTime(); // we initialize with a blank image. Throws RuntimeException if not possible (this should never happen!) - File image = ImageResizeUtil.getTransparentImage(); // tiny size is OK because we will be replacing this image. + // Ubuntu 17.10 REQUIRES this to be the correct tray image size, otherwise we get the error: + // GLib-GIO-CRITICAL **: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed + File image = ImageResizeUtil.getTransparentImage(systemTray.getTrayImageSize()); appIndicator = AppIndicator.app_indicator_new(id, image.getAbsolutePath(), AppIndicator.CATEGORY_APPLICATION_STATUS); } });