mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-3642 java/awt/Window/8159168/SetShapeTest.java fails on macOS-x64 & macOS-aarch64
make sure jb/java/awt/Focus/Typeahead* tests still pass includes fixes for JBR-3786 javax/swing/plaf/aqua/CustomComboBoxFocusTest.java fails on MacOS by timeout (cherry picked from commitf5c5388fb5) and JBR-4113 java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java fails by time out on macOS (cherry picked from commitd8d4c55a61)
This commit is contained in:
@@ -930,7 +930,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
|
||||
|
||||
int result = LWKeyboardFocusManagerPeer.shouldNativelyFocusHeavyweight(
|
||||
getTarget(), lightweightChild, temporary,
|
||||
focusedWindowChangeAllowed, time, cause, false);
|
||||
focusedWindowChangeAllowed, time, cause, true);
|
||||
switch (result) {
|
||||
case LWKeyboardFocusManagerPeer.SNFH_FAILURE:
|
||||
return false;
|
||||
@@ -984,7 +984,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
|
||||
KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
|
||||
Component focusOwner = kfmPeer.getCurrentFocusOwner();
|
||||
return LWKeyboardFocusManagerPeer.deliverFocus(lightweightChild,
|
||||
getTarget(), false, cause, focusOwner);
|
||||
getTarget(), true, cause, focusOwner);
|
||||
|
||||
case LWKeyboardFocusManagerPeer.SNFH_SUCCESS_HANDLED:
|
||||
return true;
|
||||
|
||||
@@ -1416,7 +1416,7 @@ public class LWWindowPeer
|
||||
WindowEvent windowEvent = new TimedWindowEvent(getTarget(), eventID, opposite, System.currentTimeMillis());
|
||||
|
||||
// TODO: wrap in SequencedEvent
|
||||
postEvent(windowEvent);
|
||||
SunToolkit.postPriorityEvent(windowEvent);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -116,15 +116,6 @@ public class TestDialogTypeAhead {
|
||||
b.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
System.err.println("B pressed");
|
||||
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
waitTillShown(d);
|
||||
TestDialogTypeAhead.this.d.toFront();
|
||||
TestDialogTypeAhead.this.moveMouseOver(d);
|
||||
}
|
||||
});
|
||||
|
||||
d.setVisible(true);
|
||||
}
|
||||
});
|
||||
@@ -152,6 +143,9 @@ public class TestDialogTypeAhead {
|
||||
|
||||
robot.keyPress(KeyEvent.VK_SPACE);
|
||||
robot.keyRelease(KeyEvent.VK_SPACE);
|
||||
waitTillShown(d);
|
||||
d.toFront();
|
||||
moveMouseOver(d);
|
||||
|
||||
try {
|
||||
robotSema.doWait(1000);
|
||||
|
||||
@@ -257,20 +257,23 @@ public class CustomComboBoxFocusTest {
|
||||
System.out.println("Request focus on " + target);
|
||||
final Component c = target.getEditor().getEditorComponent();
|
||||
|
||||
c.addFocusListener(new FocusListener() {
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
SwingUtilities.invokeLater(focusHandler);
|
||||
}
|
||||
if (c.isFocusOwner()) {
|
||||
SwingUtilities.invokeLater(focusHandler);
|
||||
} else {
|
||||
c.addFocusListener(new FocusListener() {
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
SwingUtilities.invokeLater(focusHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
c.requestFocus();
|
||||
}
|
||||
});
|
||||
|
||||
c.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
public Step nextStep() {
|
||||
|
||||
Reference in New Issue
Block a user