π― Summary
In the Modern Recorder, when you pick an image action and choose Capture screen, the "Choose image source" dialog stays painted on screen during the capture overlay β faint, but clearly there, and it gets baked into the captured region's backdrop.
This one's self-inflicted: it's my code (RecorderImagePicker, added in 3.0.3), not inherited. Reporting it on myself so it's tracked properly. (Different bug from #386 β that one is the live recorder's element-blind crop of the target UI, with no tool-UI leak involved. Filed separately to keep them clear.)
π¬ Reproduction
- Tools β π’ Modern Recorder β Click (or any image action).
- Choose Capture screen.
- The IDE hides and the capture overlay appears β but the "Choose image source for: click" popup is still floating in the middle, ghosted over the overlay (and into the grabbed screenshot).
𧬠Root cause β and why I got it wrong
RecorderImagePicker:
// pickImage(): modal source dialog
int choice = JOptionPane.showOptionDialog(parent, ...); // "Capture screen / Browseβ¦"
...
parent.setAlwaysOnTop(false);
return captureImage(purpose);
// captureImage(): hide, then capture IMMEDIATELY
parent.setVisible(false);
parent.getOwner().setVisible(false);
captured[0] = new Screen().userCapture("Select region for " + purpose); // β snapshots NOW
I assumed that showOptionDialog returning + setVisible(false) meant the windows were gone. They aren't: those are asynchronous native operations queued on the EDT, and userCapture() runs synchronously on that same EDT tick β it grabs the screen before the dialog's dispose and the window hides have actually been painted away. So the capture overlay's backdrop snapshot still contains the popup.
In one line: I captured the screen before the screen had a chance to clean itself up.
π₯ Impact
Every Capture in the Modern Recorder bakes a faint ghost of the source-select popup into the working screenshot β visually ugly, and it can pollute the captured region when the click is near the center.
π§ Fix direction
Let the EDT process the dismiss + the hides before snapshotting: defer userCapture() by one tick (SwingUtilities.invokeLater after hiding the windows), and/or a short settle. This mirrors how the classic IDE Capture button hides the window before grabbing. Localized to captureImage() β no behaviour change beyond the timing.
π¦
π― Summary
In the Modern Recorder, when you pick an image action and choose Capture screen, the "Choose image source" dialog stays painted on screen during the capture overlay β faint, but clearly there, and it gets baked into the captured region's backdrop.
This one's self-inflicted: it's my code (
RecorderImagePicker, added in 3.0.3), not inherited. Reporting it on myself so it's tracked properly. (Different bug from #386 β that one is the live recorder's element-blind crop of the target UI, with no tool-UI leak involved. Filed separately to keep them clear.)π¬ Reproduction
𧬠Root cause β and why I got it wrong
RecorderImagePicker:I assumed that
showOptionDialogreturning +setVisible(false)meant the windows were gone. They aren't: those are asynchronous native operations queued on the EDT, anduserCapture()runs synchronously on that same EDT tick β it grabs the screen before the dialog's dispose and the window hides have actually been painted away. So the capture overlay's backdrop snapshot still contains the popup.In one line: I captured the screen before the screen had a chance to clean itself up.
π₯ Impact
Every Capture in the Modern Recorder bakes a faint ghost of the source-select popup into the working screenshot β visually ugly, and it can pollute the captured region when the click is near the center.
π§ Fix direction
Let the EDT process the dismiss + the hides before snapshotting: defer
userCapture()by one tick (SwingUtilities.invokeLaterafter hiding the windows), and/or a short settle. This mirrors how the classic IDE Capture button hides the window before grabbing. Localized tocaptureImage()β no behaviour change beyond the timing.π¦