changeset 16309:7d77392d12c4

8168135: The issue JDK-8164462 seems not fixed in b140 Reviewed-by: serb
author ssadetsky
date Mon, 28 Nov 2016 10:36:40 +0300
parents b4776d6c9f76
children 2e5f7c4c78e5
files src/java.desktop/unix/classes/sun/awt/X11/XContentWindow.java
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/unix/classes/sun/awt/X11/XContentWindow.java	Thu Nov 24 14:11:32 2016 +0530
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XContentWindow.java	Mon Nov 28 10:36:40 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -123,15 +123,26 @@
             // Change in the size of the content window means, well, change of the size
             // Change in the location of the content window means change in insets
             boolean needHandleResize = !(newBounds.equals(getBounds()));
+            boolean needPaint = width <= 0 || height <= 0;
             reshape(newBounds);
             if (needHandleResize) {
                 insLog.fine("Sending RESIZED");
                 handleResize(newBounds);
             }
+            if (needPaint) {
+                postPaintEvent(target, 0, 0, newBounds.width, newBounds.height);
+            }
         } finally {
             XToolkit.awtUnlock();
         }
-        validateSurface();
+    }
+
+    @Override
+    public void handleExposeEvent(XEvent xev) {
+        if (width <= 0 || height <= 0) {
+            return;
+        }
+        super.handleExposeEvent(xev);
     }
 
     // NOTE: This method may be called by privileged threads.