--- old/src/java.desktop/share/classes/sun/swing/JLightweightFrame.java 2017-09-21 15:24:09.000000000 +0530 +++ new/src/java.desktop/share/classes/sun/swing/JLightweightFrame.java 2017-09-21 15:24:09.000000000 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, 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 @@ -54,6 +54,7 @@ import sun.awt.AWTAccessor; import sun.awt.DisplayChangedListener; import sun.awt.LightweightFrame; +import sun.awt.OverrideNativeWindowHandle; import sun.security.action.GetPropertyAction; import sun.swing.SwingUtilities2.RepaintListener; @@ -104,6 +105,13 @@ public void updateCursor(JLightweightFrame frame) { frame.updateClientCursor(); } + + @Override + public void overrideNativeWindowHandle(JLightweightFrame frame, long ptr) { + if (frame != null) { + frame.overrideNativeWindowHandle(ptr); + } + } }); copyBufferEnabled = "true".equals(AccessController. doPrivileged(new GetPropertyAction("swing.jlf.copyBufferEnabled", "true"))); @@ -526,6 +534,13 @@ } } + private void overrideNativeWindowHandle(long handle) { + final Object peer = AWTAccessor.getComponentAccessor().getPeer(this); + if (peer instanceof OverrideNativeWindowHandle) { + ((OverrideNativeWindowHandle) peer).overrideWindowHandle(handle); + } + } + public T createDragGestureRecognizer( Class abstractRecognizerClass, DragSource ds, Component c, int srcActions,