United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6547951 On MAWT TextArea, cursor keeps blinking after focus moved to a native window.
JDK-6547951 : On MAWT TextArea, cursor keeps blinking after focus moved to a native window.

Details
Type:
Bug
Submit Date:
2007-04-19
Status:
Closed
Updated Date:
2011-03-07
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
client-libs
OS:
linux
Sub-Component:
java.awt
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:
Relates:
Relates:
Relates:

Sub Tasks

Description
Reproduced on Redhat Enterprise Linux 4 (Update 4) with 1.6.0-b105.

On MAWT TextArea or TextField, cursor keeps blinking after focus moved to a native window.

Test instruction is as follows:
1. Compile and launch the sample code with MToolkit.
$ javac TextAreaTest
$ AWT_TOOLKIT=MToolkit java TextAreaTest
=> Two TextArea components will appear.

2. Move focus to "TextArea 1".

3. Move focus to another native window, like terminal.
=> Cursor is still blinking. <= Problem.

4. Move focus from the native window to "TextArea 2".
=> Both TextArea 1 and 2 show blinking cursor.  <= Problem.

Expected result:
Cursor should be pale color and stop blinking, after focus loses.

Focus change between these TextArea components, it works as expectedly.

Additional Information:
Motif's text widget doesn't get FocusOut event.

The problem didn't occur on Java5. It introduced from Java6.

======== TextAreaTest.java ====================================
import java.awt.*;
public class TextAreaTest {
        public TextAreaTest(String title) {
                Frame frame = new Frame(title);
                frame.add(new TextArea());
                frame.setSize(300, 100);
                frame.setVisible(true);
        }
        public static void main(String[] args) {
                TextAreaTest t1=new TextAreaTest("TextArea 1");
                TextAreaTest t2=new TextAreaTest("TextArea 2");
        }
}

                                    

Comments
WORK AROUND

None
                                     
2007-04-19
EVALUATION

I don't see any involvement of the input methods here and it looks like an AWT focus issue.  Transferring to the AWT.
                                     
2007-04-19
EVALUATION

This problem is not reproducible with XToolkit, so I'm closing it as will not fix. If anyone needs this to be fixed for MToolkit, as escalation should be filed.
                                     
2007-04-20
EVALUATION

I'm reopening the issue by the following:
1. The requestor kindly asked us to fix it if possible;
2. I've managed to fix it quite soon. The fix is easy.

In the motif code, when a widget looses focus we call for
XtSetKeyboardFocus(shell, NULL) to reset it for the widget.
However we do it under the condition of transfering focus to
another Java window. I can't see the reason of this limitation
and so I suppose we should expand the condition to any opposite
window.
                                     
2007-05-25
SUGGESTED FIX

/net/jano.sfbay/export/disk26/awt/ws/7/j2se
                                     
2007-05-28



Hardware and Software, Engineered to Work Together