IDEA-241623 Shortcuts and input stop working in IDEA after creating markdown file

GitOrigin-RevId: 9eb1c0a0b24d267e14b3714dac389074796696ce
This commit is contained in:
Anton Tarasov
2020-05-26 21:55:44 +03:00
committed by intellij-monorepo-bot
parent 8e32c52777
commit 3667b77fe9
@@ -102,7 +102,19 @@ public class JBCefBrowser implements JBCefDisposable {
myCefClient = client;
myIsDefaultClient = isDefaultClient;
myComponent = new JPanel(new BorderLayout());
myComponent = SystemInfoRt.isWindows ?
new JPanel(new BorderLayout()) {
@Override
public void removeNotify() {
if (myCefBrowser.getUIComponent().hasFocus()) {
// pass focus before removal
myCefBrowser.setFocus(false);
}
super.removeNotify();
}
} :
new JPanel(new BorderLayout());
myComponent.setBackground(JBColor.background());
myCefBrowser = cefBrowser != null ?
@@ -136,6 +148,9 @@ public class JBCefBrowser implements JBCefDisposable {
@Override
public boolean onSetFocus(CefBrowser browser, FocusSource source) {
if (source == FocusSource.FOCUS_SOURCE_NAVIGATION) {
if (SystemInfoRt.isWindows) {
myCefBrowser.setFocus(false);
}
return true; // suppress focusing the browser on navigation events
}
if (SystemInfoRt.isLinux) {