Code cleanup
This commit is contained in:
parent
ce12c0c208
commit
10ba55b9e7
@ -33,6 +33,7 @@ import dorkbox.systemTray.jna.JnaHelper;
|
|||||||
public
|
public
|
||||||
class AppIndicator {
|
class AppIndicator {
|
||||||
public static boolean isVersion3 = false;
|
public static boolean isVersion3 = false;
|
||||||
|
public static boolean isLoaded = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loader for AppIndicator, because it is absolutely mindboggling how those whom maintain the standard, can't agree to what that
|
* Loader for AppIndicator, because it is absolutely mindboggling how those whom maintain the standard, can't agree to what that
|
||||||
@ -43,8 +44,6 @@ class AppIndicator {
|
|||||||
* This is so hacky it makes me sick.
|
* This is so hacky it makes me sick.
|
||||||
*/
|
*/
|
||||||
static {
|
static {
|
||||||
boolean isLoaded = false;
|
|
||||||
|
|
||||||
// objdump -T /usr/lib/x86_64-linux-gnu/libappindicator.so.1 | grep foo
|
// objdump -T /usr/lib/x86_64-linux-gnu/libappindicator.so.1 | grep foo
|
||||||
// objdump -T /usr/lib/x86_64-linux-gnu/libappindicator3.so.1 | grep foo
|
// objdump -T /usr/lib/x86_64-linux-gnu/libappindicator3.so.1 | grep foo
|
||||||
|
|
||||||
@ -174,8 +173,6 @@ class AppIndicator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are GTK2, change the order we check and load libraries
|
// If we are GTK2, change the order we check and load libraries
|
||||||
|
@ -49,12 +49,12 @@ class Gtk {
|
|||||||
|
|
||||||
// NOTE: AppIndicator uses this info to figure out WHAT VERSION OF appindicator to use: GTK2 -> appindicator1, GTK3 -> appindicator3
|
// NOTE: AppIndicator uses this info to figure out WHAT VERSION OF appindicator to use: GTK2 -> appindicator1, GTK3 -> appindicator3
|
||||||
public static volatile boolean isGtk2 = false;
|
public static volatile boolean isGtk2 = false;
|
||||||
|
public static boolean isLoaded = false;
|
||||||
|
|
||||||
|
|
||||||
public static Function gtk_status_icon_position_menu = null;
|
public static Function gtk_status_icon_position_menu = null;
|
||||||
|
|
||||||
private static boolean alreadyRunningGTK = false;
|
private static boolean alreadyRunningGTK = false;
|
||||||
private static boolean isLoaded = false;
|
|
||||||
|
|
||||||
// This is required because the EDT needs to have it's own value for this boolean, that is a different value than the main thread
|
// This is required because the EDT needs to have it's own value for this boolean, that is a different value than the main thread
|
||||||
private static ThreadLocal<Boolean> isDispatch = new ThreadLocal<Boolean>() {
|
private static ThreadLocal<Boolean> isDispatch = new ThreadLocal<Boolean>() {
|
||||||
@ -193,14 +193,15 @@ class Gtk {
|
|||||||
|
|
||||||
if (!alreadyRunningGTK ) {
|
if (!alreadyRunningGTK ) {
|
||||||
// If JavaFX/SWT is used, this is UNNECESSARY (we can detect if the GTK main_loop is running)
|
// If JavaFX/SWT is used, this is UNNECESSARY (we can detect if the GTK main_loop is running)
|
||||||
if (SystemTray.DEBUG) {
|
|
||||||
logger.debug("Running GTK Native Event Loop");
|
|
||||||
}
|
|
||||||
|
|
||||||
gtkUpdateThread = new Thread() {
|
gtkUpdateThread = new Thread() {
|
||||||
@Override
|
@Override
|
||||||
public
|
public
|
||||||
void run() {
|
void run() {
|
||||||
|
if (SystemTray.DEBUG) {
|
||||||
|
logger.debug("Running GTK Native Event Loop");
|
||||||
|
}
|
||||||
|
|
||||||
// prep for the event loop.
|
// prep for the event loop.
|
||||||
// GThread.g_thread_init(null); would be needed for g_idle_add()
|
// GThread.g_thread_init(null); would be needed for g_idle_add()
|
||||||
|
|
||||||
|
@ -71,8 +71,6 @@ class JavaFX {
|
|||||||
|
|
||||||
public static
|
public static
|
||||||
void init() {
|
void init() {
|
||||||
// empty method to initialize class
|
|
||||||
|
|
||||||
if (dispatchMethod == null || isEventThreadMethod == null) {
|
if (dispatchMethod == null || isEventThreadMethod == null) {
|
||||||
SystemTray.logger.error("Unable to initialize JavaFX! Please create an issue with your OS and Java " +
|
SystemTray.logger.error("Unable to initialize JavaFX! Please create an issue with your OS and Java " +
|
||||||
"version so we may further investigate this issue.");
|
"version so we may further investigate this issue.");
|
||||||
|
@ -38,7 +38,6 @@ class Swt {
|
|||||||
|
|
||||||
public static
|
public static
|
||||||
void init() {
|
void init() {
|
||||||
// empty method to initialize class
|
|
||||||
if (currentDisplay == null) {
|
if (currentDisplay == null) {
|
||||||
logger.error("Unable to get the current display for SWT. Please create an issue with your OS and Java " +
|
logger.error("Unable to get the current display for SWT. Please create an issue with your OS and Java " +
|
||||||
"version so we may further investigate this issue.");
|
"version so we may further investigate this issue.");
|
||||||
|
Loading…
Reference in New Issue
Block a user