提交 cedcc7ae authored 作者: Thomas Mueller's avatar Thomas Mueller

H2 Console: requesting the status did not always show the window on top of others.

H2 Console: on some system, the browser windows got opened when requesting a new one.
上级 5b600a21
......@@ -57,6 +57,7 @@ ShutdownHandler {
//## AWT end ##
private Server web, tcp, pg;
private boolean isWindows;
private long lastOpen;
/**
* When running without options, -tcp, -web, -browser and -pg are started.
......@@ -392,6 +393,13 @@ ShutdownHandler {
// some systems don't support this method, for example IKVM
// however it still works
}
try {
// ensure this window is in front of the browser
frame.setAlwaysOnTop(true);
frame.setAlwaysOnTop(false);
} catch (Throwable t) {
// ignore
}
}
private void startBrowser() {
......@@ -400,9 +408,13 @@ ShutdownHandler {
if (urlText != null) {
urlText.setText(url);
}
long now = System.currentTimeMillis();
if (lastOpen == 0 || lastOpen + 100 < now) {
lastOpen = now;
Server.openBrowser(url);
}
}
}
//## AWT end ##
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论