mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
8155197: Focus transition issue
Reviewed-by: serb, ssadetsky, aivanov
This commit is contained in:
parent
c640ec68f7
commit
513abd0c08
2 changed files with 141 additions and 1 deletions
|
@ -191,11 +191,16 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||
private boolean doRestoreFocus(Component toFocus, Component vetoedComponent,
|
||||
boolean clearOnFailure)
|
||||
{
|
||||
boolean success = true;
|
||||
if (toFocus != vetoedComponent && toFocus.isShowing() && toFocus.canBeFocusOwner() &&
|
||||
toFocus.requestFocus(false, FocusEvent.Cause.ROLLBACK))
|
||||
(success = toFocus.requestFocus(false, FocusEvent.Cause.ROLLBACK)))
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
if (!success && getGlobalFocusedWindow() != SunToolkit.getContainingWindow(toFocus)) {
|
||||
restoreFocusTo = toFocus;
|
||||
return true;
|
||||
}
|
||||
Component nextFocus = toFocus.getNextFocusCandidate();
|
||||
if (nextFocus != null && nextFocus != vetoedComponent &&
|
||||
nextFocus.requestFocusInWindow(FocusEvent.Cause.ROLLBACK))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue