JDK-6854898 : Frame is located at the negative coordinates instead of origin for Solaris 10 CDE
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris
  • CPU: x86
  • Submitted: 2009-06-25
  • Updated: 2011-01-19
  • Resolved: 2009-09-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7 b72Fixed
Related Reports
Relates :  
The frame is getting located at negative coordinates in the screen instead of the origin ie (0,0). This is reproducible with Solaris 10 CDE Windows Manager on Jdk7b61 build.
The test worked fine on Jdk7b57 build.

Steps to Reproduce:
1. Run the attached testcase (FrameTest.java)
2. Observe the frame is located at negative coordinates.
3. Also when button "Press Me " is clicked the location of the frame is displayed on the console.

Also attached is the screenshot of one of the frame from a different test.

Many of our testcases are failing because of this issue.

SUGGESTED FIX http://sa.sfbay.sun.com/projects/awt_data/7/6854898

SUGGESTED FIX diff -r f62f7fcc9965 src/solaris/classes/sun/awt/X11/XWM.java --- a/src/solaris/classes/sun/awt/X11/XWM.java Fri May 15 15:40:35 2009 +0400 +++ b/src/solaris/classes/sun/awt/X11/XWM.java Mon Aug 24 15:03:44 2009 -0400 @@ -281,6 +281,7 @@ final class XWM XToolkit.getDefaultRootWindow(), XConstants.CWEventMask, substruct.pData); + XToolkit.XSync(); XToolkit.RESTORE_XERROR_HANDLER(); /*

EVALUATION In the particular test case, the AWT code fails to detect WM properly. The problem appears in the isNoWM method of the XWM class. To detect if WM is running AWT sets SubstructureRedirect on the root window and tries to catch any BadAccess error. These errors are expected and these should come if WM is running. The fix for 6678385 modifies WITH_XERROR_HANDLER / RESTORE_XERROR_HANDLER and removes XSync call in these methods. Hovewer, the XSync calls are needed for correct WM detection.