< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java

Print this page

        

@@ -64,10 +64,11 @@
 import sun.awt.SunToolkit;
 import sun.awt.X11GraphicsDevice;
 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 {
 
     private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XWindowPeer");

@@ -2021,10 +2022,27 @@
         }
         XToolkit.awtLock();
         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 {
                 XlibWrapper.XUnmapWindow(XToolkit.getDisplay(), getWindow());
             }
< prev index next >