diff options
Diffstat (limited to 'gnu/java')
| -rw-r--r-- | gnu/java/awt/peer/gtk/GtkMainThread.java | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/gnu/java/awt/peer/gtk/GtkMainThread.java b/gnu/java/awt/peer/gtk/GtkMainThread.java index 6efa84101..e591d2dfa 100644 --- a/gnu/java/awt/peer/gtk/GtkMainThread.java +++ b/gnu/java/awt/peer/gtk/GtkMainThread.java @@ -43,7 +43,15 @@ public class GtkMainThread extends GtkGenericPeer implements Runnable private static Thread mainThread = null; private static Object mainThreadLock = new Object(); - static native void gtkInit(); + /** + * Call gtk_init. It is very important that this happen before any other + * gtk calls. + * + * @param portableNativeSync 1 if the Java property + * gnu.classpath.awt.gtk.portable.native.sync is set to "true". 0 if it is + * set to "false". -1 if unset. + */ + static native void gtkInit(int portableNativeSync); native void gtkMain(); public GtkMainThread() @@ -67,9 +75,22 @@ public class GtkMainThread extends GtkGenericPeer implements Runnable public void run() { + /* Pass the value of the gnu.classpath.awt.gtk.portable.native.sync system + * property to C. */ + int portableNativeSync; + String portNatSyncProp = + System.getProperty("gnu.classpath.awt.gtk.portable.native.sync"); + + if (portNatSyncProp == null) + portableNativeSync = -1; // unset + else if (Boolean.valueOf(portNatSyncProp).booleanValue()) + portableNativeSync = 1; // true + else + portableNativeSync = 0; // false + synchronized (this) { - gtkInit(); + gtkInit(portableNativeSync); notify(); } gtkMain(); |
