From c7e90049e659276505249a1e6e7243d7f0b5c167 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 28 Dec 2016 23:54:06 +0100 Subject: [PATCH] Fixed isLoaded issues for Gtk and AppIndicator --- src/dorkbox/systemTray/jna/linux/AppIndicator.java | 4 ++-- src/dorkbox/systemTray/jna/linux/Gtk.java | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dorkbox/systemTray/jna/linux/AppIndicator.java b/src/dorkbox/systemTray/jna/linux/AppIndicator.java index 6cc2d8a..c86ab28 100644 --- a/src/dorkbox/systemTray/jna/linux/AppIndicator.java +++ b/src/dorkbox/systemTray/jna/linux/AppIndicator.java @@ -231,8 +231,8 @@ class AppIndicator { } } - if (shouldLoadAppIndicator) { - isLoaded = _isLoaded; + if (shouldLoadAppIndicator && _isLoaded) { + isLoaded = true; isVersion3 = _isVersion3; } else { isLoaded = false; diff --git a/src/dorkbox/systemTray/jna/linux/Gtk.java b/src/dorkbox/systemTray/jna/linux/Gtk.java index 0223e8b..5ad9558 100644 --- a/src/dorkbox/systemTray/jna/linux/Gtk.java +++ b/src/dorkbox/systemTray/jna/linux/Gtk.java @@ -167,9 +167,9 @@ class Gtk { } } - isLoaded = _isLoaded; + if (shouldLoadGtk && _isLoaded) { + isLoaded = true; - if (_isLoaded) { // depending on how the system is initialized, SWT may, or may not, have the gtk_main loop running. It will EVENTUALLY run, so we // do not want to run our own GTK event loop. _alreadyRunningGTK |= SystemTray.isSwtLoaded; @@ -182,6 +182,8 @@ class Gtk { isGtk2 = _isGtk2; isGtk3 = !_isGtk2; } else { + isLoaded = false; + alreadyRunningGTK = false; isGtk2 = false; isGtk3 = false;