JDK-8050478 : [macosx] Cursor not updating correctly after closing a modal dialog
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2014-07-15
  • Updated: 2017-11-29
  • Resolved: 2016-09-01
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 8 JDK 9
8u152Fixed 9 b137Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b22)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b21, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
os x version 10.8.5 build 12F45

A DESCRIPTION OF THE PROBLEM :
The cursor is no longer updating correctly after closing a modal dialog.

REGRESSION.  Last worked in version 7u60

ADDITIONAL REGRESSION INFORMATION: 
java version "1.7.0_60-ea"
Java(TM) SE Runtime Environment (build 1.7.0_60-ea-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- run the test
- click on the "Open" button
- a confirmation dialog appears, click on one of the option buttons
- make sure your cursor never leaves the main window and hover over the text field and table header
- notice that the cursor no longer changes to a text cursor or resize cursor.

note:
- if the confirmation dialog is closed using "enter" then everything is OK
- if one moves the cursor outside the main window, everything is OK again

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The cursor changes when placing the cursor above the text field or table header.
ACTUAL -
The cursor does not change when placed over the text field or table header.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Frame;
import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;


/**
 * Steps to reproduce:
 * 
 * - run the test
 * - click on the "Open" button
 * - a confirmation dialog appears, click on one of the option buttons
 * - make sure your cursor never leaves the main window and hover over the text field and table header
 * - notice that the cursor no longer changes to a text cursor or resize cursor.
 * 
 * note:
 * - if the confirmation dialog is closed using "enter" then everything is OK
 * - if one moves the cursor outside the main window, everything is OK again
 */
public class CursorTest
{
	@SuppressWarnings("serial")
	public void run()
	{
		JTable table = new JTable(2, 5);
		JScrollPane scrollableTable = new JScrollPane(table);
		
		JTextField textField = new JTextField();
		
		final JFrame frame = new JFrame();

		JButton button = new JButton(new AbstractAction("Open")
		{
			@Override
			public void actionPerformed(ActionEvent e)
			{
				JOptionPane.showConfirmDialog(frame, "hello");
			}
		});

		Container c = frame.getContentPane();
		c.setLayout(new BorderLayout(10, 10));
		c.add(textField, BorderLayout.PAGE_START);
		c.add(scrollableTable, BorderLayout.CENTER);
		c.add(button, BorderLayout.PAGE_END);
		
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(300, 300);
		frame.setLocationRelativeTo(null);
		frame.setExtendedState(Frame.MAXIMIZED_BOTH);
		frame.setVisible(true);
	}
	
	public static void main(String[] arguments)
	{
		SwingUtilities.invokeLater(new Runnable()
		{
			@Override
			public void run()
			{
				CursorTest test = new CursorTest();
				test.run();
			}
		});
	}
}

---------- END SOURCE ----------


Comments
Problem description: Cursor is not updated correctly after closing a modal dialog. The root cause of the issue is lack of a mouse exit event during displaying of the modal dialog. Fix: It is necessary to generate MouseExited event for the window which is going to be blocked by the modal dialog.
17-08-2016

not a regression for 9 since introduced even in 8
04-04-2016

Looks like a regression of the fir for JDK-7171045
15-07-2014

please check is it reproducible on 8 GA
15-07-2014