mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
experimental dev commit: optionally do not focus app on startup
This commit is contained in:
@@ -33,6 +33,7 @@ import com.intellij.openapi.keymap.KeymapManager;
|
||||
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;
|
||||
@@ -84,6 +85,32 @@ public class IdeFrameImpl extends JFrame implements IdeFrame, DataProvider {
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,7 @@ ide.consumeKnownToolkitBugs=true
|
||||
|
||||
ide.windowSystem.hScrollChars=15
|
||||
ide.windowSystem.vScrollChars=5
|
||||
ide.windowSystem.focusAppOnStartup=true
|
||||
|
||||
ide.tree.yeildingUiUpdate=true
|
||||
ide.tree.showBusyIndicator=true
|
||||
|
||||
Reference in New Issue
Block a user