summaryrefslogtreecommitdiffstats
path: root/src/nativewindow
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-01-16 20:30:48 +0100
committerSven Gothel <[email protected]>2023-01-16 20:30:48 +0100
commit8eb84e8234bc85f2cf096a1e24523660441d0b73 (patch)
treef693bb19d22e1fc20d0e5f56989f2b364ed2b8db /src/nativewindow
parent4b31fa321bdf02ce87648dcb7c0034b297a9e71f (diff)
SWT+AWT: Ensure SWTAccessor gets called before AWT initialization on GTK/X11 to avoid "cannot register existing type 'GdkDisplayManager'" and subsequent SIGSEGV
Diffstat (limited to 'src/nativewindow')
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
index 4a1d86eb6..bbb58d09e 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
@@ -317,6 +317,16 @@ public class SWTAccessor {
}
}
+ /**
+ * Call this method, if this class shall be initialized before any other of its methods are called
+ * within the regular workflow.
+ *
+ * This could be desired to ensure initialization before AWT.
+ *
+ * This method does nothing, but initializes this class's static SWT accessors if using this class for the first time.
+ */
+ public static void initSingleton() {}
+
private static Number getIntOrLong(final long arg) {
if(swt_uses_long_handles) {
return Long.valueOf(arg);
@@ -328,10 +338,12 @@ public class SWTAccessor {
ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
}
+ @SuppressWarnings("unused")
private static void callStaticMethodLL2V(final Method m, final long arg0, final long arg1) {
ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg0), getIntOrLong(arg1) });
}
+ @SuppressWarnings("unused")
private static void callStaticMethodLLZ2V(final Method m, final long arg0, final long arg1, final boolean arg3) {
ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg0), getIntOrLong(arg1), Boolean.valueOf(arg3) });
}