One way to fix it is to remember thread of AWT-EventQueue0 and then test if the thread that entered the TopFrame.FocusMananger is the same.
[jglick] At least in JDK 1.2.2, the thread is always a java.awt.EventDispatchThread named AWT-EventQueue-nnn and this number is incremented often, regardless of whether a modal dialog or something els
e invoked the focus manager.
Perhaps the focused component could be tested to see if it is contained in a TopComponent or the MainWindow or not.
[jglick] Now should disable all shortcuts when a dialog is being shown, except if the action uses a special property indicating it should be global, as does HelpAction.
Priority is changed to P4 (normal).