UI scaling changes from latest 2025a prerelease to official 2025a release

231 views (last 30 days)
Hi, I spent MANY hours to get my GUI running in 2025a - I included many changes to fix all the scaling issues of ui elements. I was always using the latest prerelease to implement and test these changes. Now after the "big mathworks crash", I finally could download the official 2025a release. And I notice that the scaling of ui element has completely changed and everything is messed up again. This is driving me crazy! Why are there prereleases if things are again changed in the last second?
I hope this is just a dpi scaling thing that can be fixed easily. Anyone maybe with some hints where to search?
Thanks!
  2 Comments
William
William on 4 Jun 2025
I am in contact with the support. I think, the reason for the different scaling has something to do with different scaling of character units:
MainWindow = figure('numbertitle','off','MenuBar','none','DockControls','off','Name','Test...','Toolbar','none','tag','hgui','visible','on','WindowState','maximized');
set (MainWindow,'Units','Characters');
Figure_Size = get(MainWindow, 'Position')
get(0,"ScreenPixelsPerInch")
get(0,"ScreenSize")
close(MainWindow)
This gives different results for Matlab2025 and previous (pre)releases.
Accessibility Text Scaling is at 100%, Screen scaling is at 100%, set(groot,'DefaultUicontrolFontSize',8) has no effect.

Sign in to comment.

Answers (1)

Adam Danz
Adam Danz on 29 May 2025
Edited: Adam Danz on 29 May 2025
There's a known issue using Accessibility Text Scaling on Windows that affects UI Components in R2025a and some earlier releases. The workraound is described in this report: https://www.mathworks.com/support/bugreports/details/3632276
If that does not solve the issue please work with Tech Support.
  7 Comments
Adam Danz
Adam Danz on 17 Jun 2025 at 22:56
I don't have access to your ticket right now so I don't know what tech support has tried so far.
I started investigating the code snippet you pointed to in both R2025a and R2024b.
  1. I was able to reproduce the difference in the window position values between R2025a and R2024b when using centimeter units with maximized size.
  2. To simplify the call to figure(), I removed the inputs and set defaults instead. That didn't change the behavior but it ruled out the possibility that some of the other properties were interfering.
  3. By placing a drawnow and a pause of 1 second before querying the figure position, I was able to match the values between R2025 and R2024b. The drawnow alone did not solve the problem. I did not experiment with smaller pause values-- the key is having a long enough pause for the figure to fully render. If I remove the "drawnow; pause(1)" line, the mismatch between 25a and 24b returns.
Does the drawnow + pause(1) line make a difference for you?
defaultToolbar = get(groot,'DefaultFigureToolBar');
defaultWindowState = get(groot, 'DefaultFigureWindowState');
revertDefaults = onCleanup(@()set(groot,'DefaultFigureToolBar',defaultToolbar));
revertDefaults(2) = onCleanup(@()set(groot,'DefaultFigureWindowState',defaultWindowState));
set(groot, 'DefaultFigureToolBar', 'none', ...
'DefaultFigureWindowState', 'maximized', ...
'DefaultFigureWindowStyle','normal')
MainWindow = figure();
MainWindow.Units = 'centimeters';
drawnow; pause(1) %< ------------------ this is key
Figure_Size = get(MainWindow, 'Position')
get(0,"ScreenPixelsPerInch")
get(0,"ScreenSize")
close(MainWindow)
William Thielicke
William Thielicke on 18 Jun 2025 at 4:47

Dear Adam, oh that is interesting, I will try immediately when I return from my travel. In the meantime I got a final reply from the support, stating:

"Unfortunately, I have to tell you that this is a bug that was introduced between R2025a prerelease and R2025a, while fixing something else. Our developers are working on fixing this as soon as possible, but until then, we can't provide a simple workaround. I'm very sorry for the inconvenience that this causes for you."

Sign in to comment.

Products


Release

R2025a

Community Treasure Hunt

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

Start Hunting!