void (@NotNull List<? extends CefBrowser> browsers) { if (isActive() || !Registry.is("ide.browser.jcef.hwfacade.enabled") || !isCefAppActive() || !myTarget.isShowing() || SystemInfo.isLinux) { return; } Rectangle targetBounds = new Rectangle(myTarget.getLocationOnScreen(), myTarget.getSize()); boolean overlaps = false; // [tav] todo: still won't work for JCEF component in a popup above another popup, need a smarter and faster way to check z-order for (CefBrowser browser : browsers) { Component browserComp = browser.getUIComponent(); if (browserComp != null && browserComp.isVisible() && browserComp.isShowing() && !SwingUtilities.isDescendingFrom(browserComp, myTarget) && new Rectangle(browserComp.getLocationOnScreen(), browserComp.getSize()).intersects(targetBounds)) { overlaps = true; break; } } if (overlaps) { Window owner = SwingUtilities.getWindowAncestor(myTarget); owner.addComponentListener(myOwnerListener = new ComponentAdapter() { @Override public void componentMoved(ComponentEvent e) { if (myTarget.isVisible()) { myHwFacade.setLocation(myTarget.getLocationOnScreen()); } } }); myHwFacade = new JWindow(owner); myHwFacade.add(new JPanel() { { setBackground(TRANSPARENT_COLOR); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); if (myBackBuffer != null) { g.drawImage(myBackBuffer, 0, 0, null); } } }); JdkEx.setIgnoreMouseEvents(myHwFacade, true); myHwFacade.setBounds(targetBounds); myHwFacade.setFocusableWindowState(false); JdkEx.setTransparent(myHwFacade); myHwFacade.setVisible(true); } }