diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java index e16c55675d4..5825277207b 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java @@ -275,7 +275,7 @@ public class XEmbeddedFramePeer extends XFramePeer { Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(), XToolkit.getDefaultRootWindow(), new Point(0, 0)); - return absoluteLoc.x; + return absoluteLoc != null ? absoluteLoc.x : 0; } public int getAbsoluteY() @@ -283,7 +283,7 @@ public class XEmbeddedFramePeer extends XFramePeer { Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(), XToolkit.getDefaultRootWindow(), new Point(0, 0)); - return absoluteLoc.y; + return absoluteLoc != null ? absoluteLoc.y : 0; } public int getWidth() { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java index 8cfb9ff2046..3b98cb032fb 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java @@ -849,7 +849,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { // if _NET_WM_STRUT_PARTIAL is present, we should use its values to detect // if the struts area intersects with screenBounds, however some window // managers don't set this hint correctly, so we just get intersection with windowBounds - if (windowBounds.intersects(screenBounds)) + if (windowBounds != null && windowBounds.intersects(screenBounds)) { insets.left = Math.max((int)Native.getLong(native_ptr, 0), insets.left); insets.right = Math.max((int)Native.getLong(native_ptr, 1), insets.right);