src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java

Print this page

        

@@ -42,10 +42,11 @@
 import java.util.concurrent.Callable;
 import java.net.MalformedURLException;
 
 import sun.awt.*;
 import sun.awt.datatransfer.DataTransferer;
+import sun.awt.util.ThreadGroupUtils;
 import sun.java2d.opengl.OGLRenderQueue;
 import sun.lwawt.*;
 import sun.lwawt.LWWindowPeer.PeerType;
 import sun.security.action.GetBooleanAction;
 

@@ -68,11 +69,11 @@
     // the easy way and just support up to 5 mouse buttons,
     // like Windows.
     private static final int BUTTONS = 5;
 
     private static native void initIDs();
-
+    private static native void initAppkit(ThreadGroup appKitThreadGroup, boolean headless);
     private static CInputMethodDescriptor sInputMethodDescriptor;
 
     static {
         System.err.flush();
 

@@ -117,10 +118,11 @@
 
     public LWCToolkit() {
         areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons", "true"));
         //set system property if not yet assigned
         System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled);
+        initAppkit(ThreadGroupUtils.getRootThreadGroup(), GraphicsEnvironment.isHeadless());
     }
 
     /*
      * System colors with default initial values, overwritten by toolkit if system values differ and are available.
      */

@@ -164,11 +166,11 @@
     }
 
     // This is only called from native code.
     static void systemColorsChanged() {
         EventQueue.invokeLater(() -> {
-            AccessController.doPrivileged ((PrivilegedAction<Object>) () -> {
+            AccessController.doPrivileged( (PrivilegedAction<Object>) () -> {
                 AWTAccessor.getSystemColorAccessor().updateSystemColors();
                 return null;
             });
         });
     }