Skip to content

Commit 0195e48

Browse files
committed
fix: force figures to appear in the figures container in MATLAB R2025a and above
1 parent 125ab43 commit 0195e48

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

resources/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
## Software
66

7+
- (All) Force figures to appear in the figures container in MATLAB R2025a and above
78
- (IMAP) Events recorded before the start of a test are discarded
89

910
## Project

src/visualize/+mag/+graphics/+factory/DefaultFactory.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,19 @@
2828
% Force MATLAB to finish opening any previous figure.
2929
drawnow();
3030

31+
% In MATLAB R2025a and above, force figures in the figures
32+
% container.
33+
if matlabRelease().Release >= "R2025a"
34+
windowStyle = "docked";
35+
else
36+
windowStyle = "normal";
37+
end
38+
3139
% Create and populate figure.
3240
% Make sure figure is hidden while being populated, and only
3341
% shown, if requested, at the end.
34-
f = figure(Name = options.Name, NumberTitle = "off", WindowState = options.WindowState, Visible = "off");
35-
setVisibility = onCleanup(@() set(f, Visible = matlab.lang.OnOffSwitchState(options.Visible)));
42+
f = figure(Name = options.Name, NumberTitle = "off", WindowState = options.WindowState, WindowStyle = windowStyle, Visible = "off");
43+
resetVisibility = onCleanup(@() set(f, Visible = matlab.lang.OnOffSwitchState(options.Visible)));
3644

3745
if mag.internal.isThemeable(f)
3846
f.Theme = options.Theme;

0 commit comments

Comments
 (0)