@@ -557,12 +557,24 @@ public void mousePressed(MouseEvent event) {
557557 .showDialog (myProcess .getBreakpointHandler ().getXBreakpoint (breakpoint ));
558558 }
559559 else if (event .getClickCount () == 1 && breakpoint != null && myTable .getSelectedRows ().length == 1 ) {
560- getModel ().unMarkAsNewlyReceived (breakpoint .getId ());
561- myProcess .navigateToSnapshot (breakpoint .getId ());
560+ selectSnapshot (breakpoint , false );
562561 }
563562 }
564563 }
565564
565+ private void selectSnapshot (Breakpoint breakpoint , boolean isSelectedBeforeTrigger ) {
566+ getModel ().unMarkAsNewlyReceived (breakpoint .getId ());
567+
568+ if (isSelectedBeforeTrigger || isNewlySelected (breakpoint )) {
569+ myProcess .navigateToSnapshot (breakpoint .getId ());
570+ }
571+ }
572+
573+ private boolean isNewlySelected (Breakpoint breakpoint ) {
574+ return myProcess .getCurrentSnapshot () == null
575+ || !myProcess .getCurrentSnapshot ().getId ().equals (breakpoint .getId ());
576+ }
577+
566578 /**
567579 * Create a hand cursor over a link within a table.
568580 */
@@ -645,6 +657,27 @@ public void run() {
645657 .setDisposable (myProcess .getXDebugSession ().getProject ());
646658 myBalloon = builder .createBalloon ();
647659 myBalloon .show (new RelativePoint (myTable , new Point (myTable .getWidth () / 2 , rectangle .y )), Position .above );
660+
661+ reloadSnapshot ();
662+ }
663+ }
664+
665+ /**
666+ * If the snapshot was already selected prior to being triggered,
667+ * e.g. the user selected it while in a pending state,
668+ * we need to force trigger its selection so that the new results are drawn
669+ */
670+ private void reloadSnapshot () {
671+ int selectedRow = myTable .getSelectedRow ();
672+
673+ if (selectedRow != -1
674+ && selectedRow < getModel ().getBreakpoints ().size ()
675+ && getModel ().isNewlyReceived (selectedRow )) {
676+ Breakpoint breakpoint = getModel ().getBreakpoints ().get (selectedRow );
677+
678+ if (breakpoint != null && myTable .getSelectedRows ().length == 1 ) {
679+ selectSnapshot (breakpoint , true );
680+ }
648681 }
649682 }
650683 }
0 commit comments