mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
AbstractPopup: defer final runnable execution
myFinalRunnable can contain logic which removes focus listeners (e.g. the runnable can invoke change color scheme action). In case we're called from a focus listener, which is called from java.awt.AWTEventMulticaster, removal of focus listeners will not have effect as the focus listeners list is copied on each modification. So focus listeners which have already been removed, will get invoked. Hence, we defer the final runnable execution.
This commit is contained in:
@@ -1348,9 +1348,10 @@ public class AbstractPopup implements JBPopup {
|
||||
Runnable runFinal = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//noinspection SSBasedInspection
|
||||
SwingUtilities.invokeLater(myFinalRunnable);
|
||||
//noinspection SSBasedInspection
|
||||
SwingUtilities.invokeLater(typeAheadDone.createSetDoneRunnable());
|
||||
myFinalRunnable.run();
|
||||
myFinalRunnable = null;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user