提交 9b656f29 编写于 作者: A anthony

6961754: JCK tests CvsEventTest0001 and CvsEventTest0002 fail under FF 3.5 on OEL 5

Summary: Check the return value of XlibUtil.translateCoordinates() for null
Reviewed-by: art, dcherepanov
上级 140097ae
...@@ -275,7 +275,7 @@ public class XEmbeddedFramePeer extends XFramePeer { ...@@ -275,7 +275,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(), Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(),
XToolkit.getDefaultRootWindow(), XToolkit.getDefaultRootWindow(),
new Point(0, 0)); new Point(0, 0));
return absoluteLoc.x; return absoluteLoc != null ? absoluteLoc.x : 0;
} }
public int getAbsoluteY() public int getAbsoluteY()
...@@ -283,7 +283,7 @@ public class XEmbeddedFramePeer extends XFramePeer { ...@@ -283,7 +283,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(), Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(),
XToolkit.getDefaultRootWindow(), XToolkit.getDefaultRootWindow(),
new Point(0, 0)); new Point(0, 0));
return absoluteLoc.y; return absoluteLoc != null ? absoluteLoc.y : 0;
} }
public int getWidth() { public int getWidth() {
......
...@@ -849,7 +849,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { ...@@ -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 _NET_WM_STRUT_PARTIAL is present, we should use its values to detect
// if the struts area intersects with screenBounds, however some window // if the struts area intersects with screenBounds, however some window
// managers don't set this hint correctly, so we just get intersection with windowBounds // 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.left = Math.max((int)Native.getLong(native_ptr, 0), insets.left);
insets.right = Math.max((int)Native.getLong(native_ptr, 1), insets.right); insets.right = Math.max((int)Native.getLong(native_ptr, 1), insets.right);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册