void (@NotNull LightweightHint hint, @NotNull PopupBridge popupBridge) { AtomicBoolean inProcess = new AtomicBoolean(); hint.addHintListener(e -> { if (hint.getUserData(DISABLE_BINDING) == null && inProcess.compareAndSet(false, true)) { try { AbstractPopup popup = popupBridge.getPopup(); if (popup != null) { popup.cancel(); } } finally { inProcess.set(false); } } }); popupBridge.performOnCancel(() -> { if (hint.getUserData(DISABLE_BINDING) == null && inProcess.compareAndSet(false, true)) { try { hint.hide(); } finally { inProcess.set(false); } } }); }