boolean (CefBrowser browser, FocusSource source) { Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); boolean componentFocused = focusOwner == getComponent() || focusOwner == getCefBrowser().getUIComponent(); boolean focusOnNavigation = (myFirstShow && isProperty(Properties.FOCUS_ON_SHOW) || isProperty(Properties.FOCUS_ON_NAVIGATION)) || componentFocused; myFirstShow = false; if (source == FocusSource.FOCUS_SOURCE_NAVIGATION && !focusOnNavigation) { if (SystemInfo.isWindows) { myCefBrowser.setFocus(false); } return true; // suppress focusing the browser on navigation events } if (!browser.getUIComponent().hasFocus()) { if (SystemInfo.isLinux) { if (isOffScreenRendering()) { browser.getUIComponent().requestFocusInWindow(); } else { browser.getUIComponent().requestFocus(); } } else { browser.getUIComponent().requestFocusInWindow(); } } return false; }