From 8eb84e8234bc85f2cf096a1e24523660441d0b73 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 16 Jan 2023 20:30:48 +0100 Subject: SWT+AWT: Ensure SWTAccessor gets called before AWT initialization on GTK/X11 to avoid "cannot register existing type 'GdkDisplayManager'" and subsequent SIGSEGV --- .../classes/com/jogamp/nativewindow/swt/SWTAccessor.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nativewindow/classes/com') 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) }); } -- cgit v1.2.3