JDK-6944561 : Mouse cursor stays in Text mode after leaving JTextArea or JTextField (Motif-based Toolkit only)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u18
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris
  • CPU: sparc
  • Submitted: 2010-04-16
  • Updated: 2011-02-22
  • Resolved: 2010-07-22
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.
JDK 6
6u20-rev b09Fixed
Related Reports
Relates :  
Description
With Java SE 6, the mouse cursor stays in Text mode after leaving a JTextField or JTextArea instead of coming back to the deafult arrow cursor. 
This only occurs with Motif-based Toolkit.

Comments
EVALUATION 4525839 (eliminate use of finalizers) introduced new method setPData (long pData) in class Cursor. In MToolkit it is called from native getCursor() via JNI call: (*env)->CallVoidMethod(env, jCur, cursorIDs.mSetPData, xcursor); The problem is xcursor's width, that is 32-bit int. setPData expects 64-bit value as an argument. On little-endian arch the four most significant bytes of parameter receive incorrect values. On big-endian arch xcursor's value is assigned to four most significant bytes of pData, and four least significant bytes receive random values. When pData's value is assigned to 32-bit var again, on big-endian it receives incorrect value from four least significant bytes. Hence, the issue appears on sparc.
24-06-2010

SUGGESTED FIX diff fix/awt_Cursor.c src/solaris/native/sun/awt/awt_Cursor.c 109c109 < (*env)->CallVoidMethod(env, jCur, cursorIDs.mSetPData, (jlong)xcursor); --- > (*env)->CallVoidMethod(env, jCur, cursorIDs.mSetPData, xcursor);
24-06-2010

EVALUATION MToolkit was not implemented in such a way that sun.java2d.Disposer / CursorDisposer methods work for it.
06-06-2010

EVALUATION introduced by 4525839.
31-05-2010

WORK AROUND use the XToolkit (default in Java SE 6)
16-04-2010