--- old/./build.gradle 2018-06-04 12:20:32.379362962 -0700 +++ new/./build.gradle 2018-06-04 12:20:31.743362986 -0700 @@ -1729,11 +1729,6 @@ } } -// Qualified exports needed by javafx.* modules (excluding javafx.swing) -def qualExportsCore = [ - "--add-exports=java.desktop/sun.print=javafx.graphics", -] - // Qualified exports needed by javafx.swing def qualExportsSwing = [ "--add-exports=java.desktop/java.awt.dnd.peer=javafx.swing", @@ -1819,8 +1814,6 @@ sourceSets.main.java.srcDirs += "$buildDir/gensrc/java" compileJava.dependsOn processVersionInfo - - compileJava.options.compilerArgs.addAll(qualExportsCore) } // The graphics module is needed for any graphical JavaFX application. It requires @@ -1935,7 +1928,6 @@ '-implicit:none', '--module-source-path', defaultModuleSourcePath ] ) - options.compilerArgs.addAll(qualExportsCore) } classes.dependsOn(compileFullJava) @@ -2245,8 +2237,6 @@ } } } - - compileJava.options.compilerArgs.addAll(qualExportsCore) } project(":controls") { @@ -2305,8 +2295,6 @@ into project.moduleShimsDir include "**/*.bss" }) - - compileJava.options.compilerArgs.addAll(qualExportsCore) } project(":swing") { @@ -2342,7 +2330,6 @@ } } - compileJava.options.compilerArgs.addAll(qualExportsCore) compileJava.options.compilerArgs.addAll(qualExportsSwing) } @@ -2436,8 +2423,6 @@ // FIXME: change this to also allow JDK 9 boot jdk classpath += files("$JDK_HOME/jre/lib/ext/nashorn.jar") } - - compileJava.options.compilerArgs.addAll(qualExportsCore) } project(":fxpackagerservices") { @@ -3638,8 +3623,6 @@ dependsOn buildNativeTargets } } - - compileJava.options.compilerArgs.addAll(qualExportsCore) } project(":web") { @@ -3870,8 +3853,6 @@ if (IS_COMPILE_WEBKIT) { assemble.dependsOn compileJavaDOMBinding, drtJar } - - compileJava.options.compilerArgs.addAll(qualExportsCore) } // This project is for system tests that need to run with a full SDK. --- old/modules/javafx.graphics/src/main/java/com/sun/prism/j2d/print/J2DPrinterJob.java 2018-06-04 12:20:33.171362931 -0700 +++ new/modules/javafx.graphics/src/main/java/com/sun/prism/j2d/print/J2DPrinterJob.java 2018-06-04 12:20:32.903362942 -0700 @@ -80,6 +80,8 @@ import com.sun.javafx.stage.WindowHelper; import com.sun.javafx.tk.TKStage; import com.sun.javafx.tk.Toolkit; +import com.sun.glass.utils.NativeLibLoader; +import com.sun.prism.impl.PrismSettings; import com.sun.prism.j2d.PrismPrintGraphics; @@ -89,6 +91,21 @@ public class J2DPrinterJob implements PrinterJobImpl { + static { + AccessController.doPrivileged((PrivilegedAction) () -> { + String libName = "prism_common"; + + if (PrismSettings.verbose) { + System.out.println("Loading Prism common native library ..."); + } + NativeLibLoader.loadLibrary(libName); + if (PrismSettings.verbose) { + System.out.println("\tsucceeded."); + } + return null; + }); + } + javafx.print.PrinterJob fxPrinterJob; java.awt.print.PrinterJob pJob2D; javafx.print.Printer fxPrinter; @@ -106,17 +123,25 @@ PrintRequestAttribute alwaysOnTop = null; try { if (onTopClass == null) { - onTopClass = Class.forName("sun.print.DialogOnTop"); + onTopClass = + Class.forName("javax.print.attribute.standard.DialogOwner"); + } + if (id == 0) { + Constructor + cons = onTopClass.getConstructor(); + alwaysOnTop = cons.newInstance(); + } else { + alwaysOnTop = getAlwaysOnTop(onTopClass, id); } - Constructor cons = - onTopClass.getConstructor(long.class); - alwaysOnTop = cons.newInstance(id); } catch (Throwable t) { } return alwaysOnTop; }); } + private static native + PrintRequestAttribute getAlwaysOnTop(Class onTopClass, long id); + public J2DPrinterJob(javafx.print.PrinterJob fxJob) { fxPrinterJob = fxJob; @@ -159,7 +184,10 @@ printReqAttrSet.remove(onTopClass); } if (owner != null) { - long id = WindowHelper.getPeer(owner).getRawHandle(); + long id = 0L; + if (PlatformUtil.isWindows()) { + id = WindowHelper.getPeer(owner).getRawHandle(); + } PrintRequestAttribute alwaysOnTop = getAlwaysOnTop(id); if (alwaysOnTop != null) { printReqAttrSet.add(alwaysOnTop); @@ -230,7 +258,10 @@ printReqAttrSet.remove(onTopClass); } if (owner != null) { - long id = WindowHelper.getPeer(owner).getRawHandle(); + long id = 0L; + if (PlatformUtil.isWindows()) { + id = WindowHelper.getPeer(owner).getRawHandle(); + } PrintRequestAttribute alwaysOnTop = getAlwaysOnTop(id); if (alwaysOnTop != null) { printReqAttrSet.add(alwaysOnTop); --- /dev/null 2018-05-25 11:37:39.280540387 -0700 +++ new/modules/javafx.graphics/src/main/native-prism/PrismPrint.c 2018-06-04 12:20:33.467362920 -0700 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include + +/* + * Class com_sun_prism_j2d_print_J2DPrinterJob2D + * Method: getAlwaysOnTop + * Signature (Ljava/lang/Class;J)Ljavax.print.attribute.standard.DialogOwner; + */ +JNIEXPORT jobject +Java_com_sun_prism_j2d_print_J2DPrinterJob_getAlwaysOnTop( + JNIEnv *env, jclass cls, jclass ownerClass, jlong id) { + + jmethodID cons; + if (ownerClass == NULL) { + return NULL; + } + cons = (*env)->GetMethodID(env, ownerClass, "", "(J)V"); + if (cons == NULL || (*env)->ExceptionCheck(env)) { + return NULL; + } + return (*env)->NewObject(env, ownerClass, cons, id); +} + --- old/dependencies/java.desktop/module-info.java.extra 2018-06-04 12:20:34.123362895 -0700 +++ /dev/null 2018-05-25 11:37:39.280540387 -0700 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -exports java.awt.dnd.peer to javafx.swing; -exports sun.awt to javafx.swing; -exports sun.awt.dnd to javafx.swing; -exports sun.awt.image to javafx.swing; -exports sun.java2d to javafx.swing; -exports sun.swing to javafx.swing; -exports sun.print to javafx.graphics;