src/solaris/classes/sun/awt/X11/XWindowPeer.java

Print this page

        

@@ -127,12 +127,10 @@
      */
     private static final int MAXIMUM_BUFFER_LENGTH_NET_WM_ICON = (2<<15) - 1;
 
     void preInit(XCreateWindowParams params) {
         target = (Component)params.get(TARGET);
-        params.put(REPARENTED,
-                   Boolean.valueOf(isOverrideRedirect() || isSimpleWindow()));
         super.preInit(params);
         params.putIfNull(BIT_GRAVITY, Integer.valueOf(XConstants.NorthWestGravity));
 
         long eventMask = 0;
         if (params.containsKey(EVENT_MASK)) {

@@ -515,17 +513,10 @@
         postEvent(new WindowEvent((Window)target,
                                   WindowEvent.WINDOW_STATE_CHANGED,
                                   oldState, newState));
     }
 
-    /**
-     * DEPRECATED:  Replaced by getInsets().
-     */
-    public Insets insets() {
-        return getInsets();
-    }
-
     boolean isAutoRequestFocus() {
         if (XToolkit.isToolkitThread()) {
             return WindowAccessor.isAutoRequestFocus((Window)target);
         } else {
             return ((Window)target).isAutoRequestFocus();

@@ -712,10 +703,14 @@
     @Override
     public void handleConfigureNotifyEvent(XEvent xev) {
         // TODO: We create an XConfigureEvent every time we override
         // handleConfigureNotify() - too many!
         XConfigureEvent xe = xev.get_xconfigure();
+        if (xe.get_window() != getWindow()) {
+            return;
+        }
+
         checkIfOnNewScreen(new Rectangle(xe.get_x(),
                                          xe.get_y(),
                                          xe.get_width(),
                                          xe.get_height()));
 

@@ -1175,10 +1170,14 @@
             }
         }
     }
 
     public void handleMapNotifyEvent(XEvent xev) {
+        if (xev.get_xany().get_window() != getWindow()) {
+            return;
+        }
+
         // See 6480534.
         isUnhiding |= isWMStateNetHidden();
 
         super.handleMapNotifyEvent(xev);
         if (!winAttr.initialFocus) {

@@ -1209,10 +1208,13 @@
             }
         }
     }
 
     public void handleUnmapNotifyEvent(XEvent xev) {
+        if (xev.get_xany().get_window() != getWindow()) {
+            return;
+        }
         super.handleUnmapNotifyEvent(xev);
 
         // On Metacity UnmapNotify comes before PropertyNotify (for _NET_WM_STATE_HIDDEN).
         // So we also check for the property later in MapNotify. See 6480534.
         isUnhiding |= isWMStateNetHidden();

@@ -1295,15 +1297,24 @@
             else
                 return hasBits;
         }
     }
 
-    void setReparented(boolean newValue) {
-        super.setReparented(newValue);
+    @Override
+    public boolean mayBeReparented() {
+        return
+            !isOverrideRedirect() &&
+            !isSimpleWindow() &&
+            super.mayBeReparented();
+    }
+
+    @Override
+    public void setNativeParent(long parent) {
+        super.setNativeParent(parent);
         XToolkit.awtLock();
         try {
-            if (isReparented() && delayedModalBlocking) {
+            if (!mayBeReparented() && delayedModalBlocking) {
                 addToTransientFors((XDialogPeer) ComponentAccessor.getPeer(modalBlocker));
                 delayedModalBlocking = false;
             }
         } finally {
             XToolkit.awtUnlock();

@@ -1389,22 +1400,22 @@
                 XDialogPeer blockerPeer = (XDialogPeer) ComponentAccessor.getPeer(d);
                 if (blocked) {
                     log.log(Level.FINE, "{0} is blocked by {1}", new Object[] { this, blockerPeer});
                     modalBlocker = d;
 
-                    if (isReparented() || XWM.isNonReparentingWM()) {
+                    if (!mayBeReparented()) {
                         addToTransientFors(blockerPeer, javaToplevels);
                     } else {
                         delayedModalBlocking = true;
                     }
                 } else {
                     if (d != modalBlocker) {
                         throw new IllegalStateException("Trying to unblock window blocked by another dialog");
                     }
                     modalBlocker = null;
 
-                    if (isReparented() || XWM.isNonReparentingWM()) {
+                    if (!mayBeReparented()) {
                         removeFromTransientFors();
                     } else {
                         delayedModalBlocking = false;
                     }
                 }