import com.intellij.openapi.project.DumbAwareRunnable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.wm.IdeFrame;
import com.intellij.openapi.wm.ex.LayoutFocusTraversalPolicyExt;
import com.intellij.openapi.wm.ex.StatusBarEx;
new MnemonicHelper().register(this);
myBalloonLayout = new BalloonLayout(myRootPane.getLayeredPane(), new Insets(8, 8, 8, 8));
+
+ if (!Registry.is("ide.windowSystem.focusAppOnStartup") && !isThereActiveFrame()) {
+ setFocusableWindowState(false);
+ }
+
+ }
+
+ private boolean isThereActiveFrame() {
+ Frame[] all = Frame.getFrames();
+ for (Frame each : all) {
+ if (each.isActive()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public void show() {
+ super.show();
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ setFocusableWindowState(true);
+ }
+ });
}
/**
ide.windowSystem.hScrollChars=15
ide.windowSystem.vScrollChars=5
+ide.windowSystem.focusAppOnStartup=true
ide.tree.yeildingUiUpdate=true
ide.tree.showBusyIndicator=true