--- old/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2018-11-25 21:42:07 +0000 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2018-11-25 21:42:07 +0000 @@ -66,6 +66,7 @@ import sun.awt.X11GraphicsEnvironment; import sun.java2d.pipe.Region; import sun.util.logging.PlatformLogger; +import sun.font.FontUtilities; class XWindowPeer extends XPanelPeer implements WindowPeer, DisplayChangedListener { @@ -2023,6 +2024,23 @@ try { this.visible = visible; if (visible) { + if (FontUtilities.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); + } + } + } + } applyWindowType(); XlibWrapper.XMapRaised(XToolkit.getDisplay(), getWindow()); } else {