< prev index next >

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

Print this page

        

@@ -801,27 +801,36 @@
      * Overridden to check if we need to update our GraphicsDevice/Config
      * Added for 4934052.
      */
     @Override
     public void handleConfigureNotifyEvent(XEvent xev) {
+        assert (SunToolkit.isAWTLockHeldByCurrentThread());
         XConfigureEvent xe = xev.get_xconfigure();
-        /*
-         * Correct window location which could be wrong in some cases.
-         * See getNewLocation() for the details.
-         */
-        Point newLocation = getNewLocation(xe, 0, 0);
-        xe.set_x(scaleUp(newLocation.x));
-        xe.set_y(scaleUp(newLocation.y));
-        checkIfOnNewScreen(new Rectangle(newLocation.x,
-                                         newLocation.y,
+        if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
+            insLog.fine(xe.toString());
+        }
+        checkIfOnNewScreen(toGlobal(new Rectangle(scaleDown(xe.get_x()),
+                scaleDown(xe.get_y()),
                                          scaleDown(xe.get_width()),
-                                         scaleDown(xe.get_height())));
+                scaleDown(xe.get_height()))));
+
+        Rectangle oldBounds = getBounds();
+
+        x = scaleDown(xe.get_x());
+        y = scaleDown(xe.get_y());
+        width = scaleDown(xe.get_width());
+        height = scaleDown(xe.get_height());
+        
+        if (!getBounds().getSize().equals(oldBounds.getSize())) {
+            AWTAccessor.getComponentAccessor().setSize(target, width, height);
+            postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED));
+        }
+        if (!getBounds().getLocation().equals(oldBounds.getLocation())) {
+            AWTAccessor.getComponentAccessor().setLocation(target, x, y);
+            postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_MOVED));
+        }
 
-        // Don't call super until we've handled a screen change.  Otherwise
-        // there could be a race condition in which a ComponentListener could
-        // see the old screen.
-        super.handleConfigureNotifyEvent(xev);
         repositionSecurityWarning();
     }
 
     final void requestXFocus(long time) {
         requestXFocus(time, true);
< prev index next >