Updates June 12, 2020:
- There is a recognized bug report on a very similar issue: https://www.mathworks.com/support/bugreports/1987277 - this bug report is about function hints, but presumably it's the same underlying problem as for help popups.
- The following code snippet is supposed to close any open help popups or function hints:
ws = com.mathworks.mwswing.window.MJFullWindowRegistry.windows;
while ws.hasMoreElements, w=ws.nextElement; if any(strcmp(w.getName,{'HelpPopup','FunctionHints'})),w.dispose,end, end
The "stuck popup" problem has annoyed me for years. I notice them, for example, if I display a large multi-line data-tip (or the code that's displayed when you hover the mouse above the "..." in folded code) in the editor and then switch to another editor file very quickly. The popup then gets stuck. As noted above, these popups are not a figure and no programmatic close of figures closes them.
My experience has been that the following combination of actions can sometimes (not always, nor predictably) assist:
- click the Esc key
- hover the mouse on top of another "..." of folded code
- switch to another editor file
- switch to another application that will hide (overlap) Matlab, and then switch back to Matlab
In the case of a function help, try clicking F1 to try to replace the persistent popup with a new one (that will hopefully be more well-behaved), then dismiss it in the normal way.
Unfortunately, I am not aware of a programmatic way to dismiss tooltip popups in the Editor.
Best Answer