boolean (@NotNull Task task) { long start = System.currentTimeMillis(); boolean result = super.runProcessWithProgressSynchronously(task); if (result) { long end = System.currentTimeMillis(); Task.NotificationInfo notificationInfo = task.notifyFinished(); long time = end - start; if (notificationInfo != null && time > 5000) { // show notification only if process took more than 5 secs JFrame frame = WindowManager.getInstance().getFrame(task.getProject()); if (frame != null && !frame.hasFocus()) { systemNotify(notificationInfo); } } } return result; }