EVALUATION
changeset: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/0fad89bd606b
|
|
|
EVALUATION
[SQE]
Risk: medium
To test the fix run the tests:
test/java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java
test/java/awt/Mouse/EnterExitEvents/DragWindowTest.java
test/java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java
[SQE]
|
|
|
EVALUATION
Assume we are dragging a window over a frame. After dragging a window and released a button the MAC OS X native system puts mouse entered event to a dragging window. So the window peer starts mouse exited process from the frame. Than window peer starts to enter to the frame so the mouse release events goes not to component where the mouse was initially clicked.
|
|
|
EVALUATION
The attached TestDrag class shows the problem.
A JLbale has a mouse listener which tracks mouseReleased event.
Drag mouse from the the JLable to JButton. The 'released' string is printed.
Drag mouse from the the JLable to JButton the second time. The 'released' string is not printed.
This is because in the second time there are two events MouseExited and Mouse Entered before the MouseReleased. So the MouseReleased events goes to the JButton instead of the JLabel.
|
|
|
PUBLIC COMMENTS
Code to reproduce:
--------------------------
mport java.awt.BorderLayout;
import javax.swing.*;
public class MyToolBar {
public static void main(String[] args) throws Exception {
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
JFrame frame = new JFrame("ToolBar test");
frame.setSize(400, 400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//JToolBar tbar = new JToolBar(JToolBar.VERTICAL);
JToolBar tbar = new JToolBar(JToolBar.TOP);
tbar.add(new JButton("A"));
tbar.add(new JButton("B"));
tbar.add(new JButton("C"));
JButton b = new JButton("Hello");
frame.getContentPane().add(b, BorderLayout.CENTER);
frame.getContentPane().add(tbar, BorderLayout.EAST);
frame.setVisible(true);
}
});
}
}
--------------------------
|
|
|
EVALUATION
Reproduced. Toolbar docking seems utterly broken on Mac. In bug4331392, sometimes instead of docking we get an original toolbar, detached toolbar somewhere aside and the outlay of toolbar moving together with it but far away.
In bug4251592 it is even more weird: sometimes a detached toolbox move invisible behind the instruction window together with outlay.
Then again, it is broken in jdk8 on XAWT as well, if not so bad. Test bug4251592 shows that one can dock toolbar horizontally but instead of vertical toolbar, one get still a horizontal one on top with buttons filling all the area.
|
|
|