How can I clear stuck help popups?

조회 수: 39 (최근 30일)
Chuck37
Chuck37 2020년 4월 1일
댓글: Adee 2021년 11월 22일
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.

채택된 답변

Yair Altman
Yair Altman 2020년 4월 2일
편집: Yair Altman 2020년 6월 12일
Updates June 12, 2020:
  1. 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.
  2. 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:
  1. click the Esc key
  2. hover the mouse on top of another "..." of folded code
  3. switch to another editor file
  4. 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.
  댓글 수: 3
Philip Gillibrand
Philip Gillibrand 2021년 7월 23일
yes, that code snippet works!! finally able to rmove those popups without restarting matlab. thanks very much.
Adee
Adee 2021년 11월 22일
Yair, you rock, touch down, slam dunk again. I could guess you would provide the solution to this long frustrating problem - just had to get mad enough to look for it... Tons of thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Adam Danz
Adam Danz 2020년 4월 1일
편집: Adam Danz 2020년 4월 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
Adam Danz
Adam Danz 2020년 4월 2일
편집: Adam Danz 2020년 4월 2일
Ah, you mean function hints.
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
Image Analyst 2020년 4월 2일
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
Unal Ege Gaznepoglu 2020년 6월 2일
편집: Unal Ege Gaznepoglu 2020년 6월 2일
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.

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by