void (@NotNull SessionEvent event, @NotNull XDebugSession session) { myRefresh = event == SessionEvent.SETTINGS_CHANGED; if (event == SessionEvent.BEFORE_RESUME) { return; } XExecutionStack currentExecutionStack = ((XDebugSessionImpl)session).getCurrentExecutionStack(); XStackFrame currentStackFrame = session.getCurrentStackFrame(); XSuspendContext suspendContext = session.getSuspendContext(); if (event == SessionEvent.FRAME_CHANGED && Objects.equals(mySelectedStack, currentExecutionStack)) { ThreadingAssertions.assertEventDispatchThread(); if (currentStackFrame != null) { myFramesList.setSelectedValue(currentStackFrame, true); mySelectedFrameIndex = myFramesList.getSelectedIndex(); myExecutionStacksWithSelection.put(mySelectedStack, mySelectedFrameIndex); } return; } EdtExecutorService.getInstance().execute(() -> { if (event != SessionEvent.SETTINGS_CHANGED) { mySelectedFrameIndex = 0; mySelectedStack = null; myVisibleRect = null; } else { myVisibleRect = myFramesList.getVisibleRect(); } myListenersEnabled = false; myBuilders.values().forEach(StackFramesListBuilder::dispose); myBuilders.clear(); if (suspendContext == null) { requestClear(); return; } if (event == SessionEvent.PAUSED) { // clear immediately cancelClear(); clear(); } XExecutionStack activeExecutionStack = mySelectedStack != null ? mySelectedStack : currentExecutionStack; addExecutionStacks(Collections.singletonList(activeExecutionStack), false); myThreadComboBox.setSelectedItem(activeExecutionStack); boolean invisible = activeExecutionStack == null || StringUtil.isEmpty(activeExecutionStack.getDisplayName()); if (invisible != (myThreadComboBox.getParent() == null)) { if (invisible) { myThreadsPanel.remove(myThreadComboBox); myThreadsPanel.setBorder(null); } else { myThreadsPanel.add(myThreadComboBox, BorderLayout.CENTER); myThreadsPanel.setBorder(new CustomLineBorder(0, 0, 1, 0)); } myThreadsPanel.revalidate(); } updateFrames(activeExecutionStack, session, event == SessionEvent.FRAME_CHANGED ? currentStackFrame : null, event == SessionEvent.SETTINGS_CHANGED); }); }