boolean (Project project) { final Component owner = IdeFocusManager.getInstance(project).getFocusOwner(); if (owner != null) { final DialogWrapper instance = DialogWrapper.findInstance(owner); return instance != null && instance.isModal(); } return false; }