Figure steals focus from parent app on update
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I have an app from which the user can run analysis functions which create some plots in new figure windows. These plots update during the analysis via changing the handle properties of the graphics objects.
My issue is that every time the figure updates it steals focus from the app. If you're working in another program entirely, it won't steal focus from that, but it will steal focus from any window which is part of the same Matlab session the app is running from.
This is a problem because I want the user to be able to still use the app (e.g. to pause the analysis) whilst the analysis is running, and it is irritating if the focus is lost whilst you're about to click a button, or if you're dragging the window to a different location on the screen.
I've seen one proposed solution to similar questions is to set the figure handle visibility to false. This is problematic for me, because I'm saving the figures to files, and if you save an figure with visibility=false, it will be still invisible still when you load it.
Can anyone suggest any solutions or workarounds for the above? Many thanks
댓글 수: 0
답변 (1개)
Image Analyst
2022년 8월 9일
It's been a problem for years. It doesn't always seem to happen but when it does it's very annoying. I remember one time it wasn't happening but if I stopped at a breakpoint, then it would happen always after that.
The only workaround I know of is to have a "display" flag that you set in advance to not do any display/imaging/graphing functions.
Maybe search the forum for "steal focus" for prior discussions.
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!