JDK-2121072 : XAWT: crash when displaying hw combobox popup on secondary screen (sol/lin)
  • Type: Backport
  • Backport of: JDK-5108694
  • Component: client-libs
  • Sub-Component: java.awt
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2004-10-21
  • Updated: 2011-01-19
  • Resolved: 2004-12-21
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.
Other JDK 6
5.0u2 b04Fixed 6Fixed
Comments
SUGGESTED FIX First change has no immediate relation to the fix: it is just should make code more robust. in src/solaris/native/sun/xawt/XlibWrapper.c *** 962,971 **** --- 962,974 ---- */ JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_XScreenNumberOfScreen (JNIEnv *env, jclass clazz, jlong screen) { AWT_CHECK_HAVE_LOCK(); + if((Screen*)screen == NULL) { + return -1; + } return XScreenNumberOfScreen((Screen*)screen); } And this is the fix itself: just remove a clause src/solaris/classes/sun/awt/X11/XBaseWindow.java *** 176,190 **** params.putIfNull(VALUE_MASK, new Long(XlibWrapper.CWEventMask)); Rectangle bounds = (Rectangle)params.get(BOUNDS); bounds.width = Math.max(MIN_SIZE, bounds.width); bounds.height = Math.max(MIN_SIZE, bounds.height); - Boolean overrideRedirect = (Boolean)params.get(OVERRIDE_REDIRECT); - if (Boolean.TRUE.equals(overrideRedirect)) { - params.put(PARENT_WINDOW, new Long(XToolkit.getDefaultRootWindow())); - } - Long eventMaskObj = (Long)params.get(EVENT_MASK); long eventMask = eventMaskObj != null ? eventMaskObj.longValue() : 0; // We use our own synthetic grab see XAwtState.getGrabWindow() // (see X vol. 1, 8.3.3.2) eventMask |= PropertyChangeMask | OwnerGrabButtonMask; --- 176,185 ---- ###@###.### 10/15/04 10:54 GMT ------- XChoicePeer.java ------- *** /tmp/sccs.PXtVbK 2004-11-09 17:00:40.000000000 +0300 --- XChoicePeer.java 2004-11-09 16:48:44.000000000 +0300 *************** *** 519,527 **** // Override so we can do our own create() public void preInit(XCreateWindowParams params) { super.preInit(params); ! // Reset parent window, bounds(we'll set them later), set overrideRedirect ! params.add(PARENT_WINDOW, (long)0); params.remove(BOUNDS); params.add(OVERRIDE_REDIRECT, Boolean.TRUE); } --- 519,530 ---- // Override so we can do our own create() public void preInit(XCreateWindowParams params) { + // A parent of this window is the target, at this point: wrong. + // Remove parent window; in the following preInit() call we'll calculate as a default + // a correct root window which is the proper parent for override redirect. + params.delete(PARENT_WINDOW); super.preInit(params); ! // Reset bounds(we'll set them later), set overrideRedirect params.remove(BOUNDS); params.add(OVERRIDE_REDIRECT, Boolean.TRUE); } ###@###.### 2004-11-09 14:01:15 GMT ###@###.### 2004-11-18 14:28:13 GMT
18-11-2004

EVALUATION See the evaluation in 5108694 ###@###.### 10/25/04 16:49 GMT Combined fix added, with addition from 6191341. ###@###.### 2004-11-18 14:28:12 GMT
25-10-2004