--- old/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2019-03-01 21:36:08 +0000 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2019-03-01 21:36:07 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, 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 @@ -66,6 +66,7 @@ import sun.awt.X11GraphicsEnvironment; import sun.java2d.pipe.Region; import sun.util.logging.PlatformLogger; +import sun.awt.OSInfo; class XWindowPeer extends XPanelPeer implements WindowPeer, DisplayChangedListener { @@ -120,6 +121,8 @@ */ private Window.Type windowType = Window.Type.NORMAL; + private static final boolean isAIX = OSInfo.getOSType() == OSInfo.OSType.AIX; + public final Window.Type getWindowType() { return windowType; } @@ -2024,6 +2027,23 @@ this.visible = visible; if (visible) { applyWindowType(); + if (isAIX) { + /* On Motif Window Manager, non-focusable window should not set WM_TAKE_FOCUS */ + XAtomList currentWMProtocols = wm_protocols.getAtomListPropertyList(this); + if (isFocusableWindow()) { + if (!currentWMProtocols.contains(wm_take_focus)) { + currentWMProtocols.add(wm_take_focus); + wm_protocols.setAtomListProperty(this, currentWMProtocols); + } + } else { + if (XWM.isMotif()) { + if (currentWMProtocols.contains(wm_take_focus)) { + currentWMProtocols.remove(wm_take_focus); + wm_protocols.setAtomListProperty(this, currentWMProtocols); + } + } + } + } XlibWrapper.XMapRaised(XToolkit.getDisplay(), getWindow()); } else { XlibWrapper.XUnmapWindow(XToolkit.getDisplay(), getWindow());