How can I clear stuck help popups?
Show older comments
2019a Matlab on Linux. Sometimes a help popup for a function (or similar) will pop up from the GUI and refuse to go away when it normally would. They continue to sit there and block what is behind them. It stays at a constant place on the screen, so I can sometimes move the window around to get my work done. Is there any way to clear them short of killing matlab and starting over? This is not on a figure, it's in the command window or editor.
Accepted Answer
More Answers (2)
Note: This answer does not address the problem of stuck function hints and other pop-up messages internal to Matlab. It addresses figures that won't close which I misunderstood to be to problem explained by OP.
Quick fix for current figure:
Make sure the stubborn figure is current (rather than your GUI) and then execute,
close(get(groot,'CurrentFigure'), 'force')
This will not work on UIFigures since their handles are not visible.
Quick fix for all stubborn figures (UIFigures, too)
To close all figures with CloseRequestFcn functions that aren't set to the default closereq,
% Get list of all open figures
allFigs = findall(0, 'Type', 'Figure');
% Identify which figures have the default close req fcn
isDefault = cellfun(@(h)strcmpi(h, 'closereq'), get(allFigs, 'CloseRequestFcn'));
% Close all figures with non-default close req fcn
delete(allFigs(~isDefault))
Better option:
Find where the stubborn figure is created and set its CloseRequestFcn
% fig is the figure handle
fig.CloseRequestFcn = 'closereq';
7 Comments
John D'Errico
on 1 Apr 2020
There is also the
close all force
command, in case you just want zap the rest of the open figures too.
Les Beckham
on 1 Apr 2020
I don't know the answer to this, but just in case someone else does, I thought it should be pointed out that the OP's problem is not with popups in figure windows: "This is not on a figure, it's in the command window or editor."
Image Analyst
on 2 Apr 2020
Edited: Image Analyst
on 2 Apr 2020
I guess he means like the tooltip string that pops up, rather than what MATLAB calls a popup (and everyone else calls a drop down list). Like when you hover the cursor over a variable and it shows the numerical contents of variables, or you type a left parenthesis and it pops up a context sensitive list of arguments, methods, or properties, for example. On occasion I've seen this. I assumed it was some kind of OS repaint glitch. I think I've gotten rid of it by doing something to make another yellow popup panel appear over it. Then the OS seems to repaint the the current popup and get rid of the old one. Though it's hard to reproduce so I can't test it now.
Chuck37
on 2 Apr 2020

I don't know if this will fix the problem but try turning them off.
Go to Preferences > keyboard, then uncheck "Enable function hints".

Image Analyst
on 2 Apr 2020
I'm not sure who gets rid of it. The screen needs to be repainted, so who sends the message to repaint and who does the repainting? If another app is below/behind it, does that app get a signal to repaint itself? Or does the OS repaint it? I doubt MATLAB remembers what was behind it and repaints it because the app may look different from the time MATLAB started to when it closed. And I don't see how the OS would know what should be painted. What I think happens (and maybe I'll poke Yair to see if he knows for sure) is that the OS knows MATLAB shutdown, and the OS sends a message to the underlying app (or the OS itself if there is no other app underneath MATLAB) and that underlying app is responsible for repainting itself. So either way the "stuck popup" in the screen memory gets painted over when the underlying app or the OS repaints its client area.
Unal Ege Gaznepoglu
on 2 Jun 2020
Edited: Unal Ege Gaznepoglu
on 2 Jun 2020
0 votes
I am also experiencing this problem and I must say it is extremely annoying. I have appended two screenshots. Sadly, I couldn't get the initial popup, as it disappeared but fixed the command window output instead. Unfortunately the suggestions by @Yair did not help. If this happens, the only way to get rid of it is to restart MATLAB.
(Edit: The java exceptions in the command window are unrelated with the popup problem.)
One thing I have noticed is if I undock the editor and command window, the popup is stuck on the main gui and not on them. 


Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!