IDEA-133699 Focus is stolen by IDEA to activate editor after project opening

This commit is contained in:
Denis Fokin
2014-12-18 14:16:13 +03:00
parent 733c317f39
commit c7d8b98c01
@@ -123,8 +123,11 @@ public class SheetMessage {
focusCandidate = IdeFocusManager.getGlobalInstance().getLastFocusedFor(IdeFocusManager.getGlobalInstance().getLastFocusedFrame());
}
LOG.assertTrue(focusCandidate != null, "The should return focus on closing the message");
focusCandidate.requestFocus();
// focusCandidate is null if a welcome screen is closed and ide frame is not opened.
// this is ok. We set focus correctly on our frame activation.
if (focusCandidate != null) {
focusCandidate.requestFocus();
}
}
private static void maximizeIfNeeded(final Window owner) {