Alexander Halser 26 Posted January 25, 2022 (edited) I've come across a problem with FMX apps and high-contrast Windows themes. The automatic window scaling doesn't work in this case. I wonder if this is a known problem and if yes, if it is Delphi related or Windows related? You should be able to reproduce this in the following way: 1) Create an FMX app with a simple form 2) Make the app per-monitor-dpi-aware-v2 3) Run it normally on Windows 10 on a monitor with more than 96 dpi (scaling > 100%) 4) Switch to a high-contrast theme, repeat step (3) 5) On Windows 7 the same effect can be observed with a "basic" vs. a "classic" theme Delphi versions: tested with Delphi 10.1 and 10.4 (same result). Not tested with Delphi 11. My observations: On Win10 with a regular theme, the app behaves as it should. When started on a monitor with 96 dpi, Form1.Handle.Scale = 1 (as expected). Started from a monitor with 192 dpi (200%), Form1.Handle.Scale = 2, as expected. Moving between monitors with different resolution/scaling instantly changes the scale. On Win10 with a high-contrast theme, scaling does no longer work. When started from a monitor with 192 dpi, the form stays at its original size, as if it never received a scaling message. Moving the app between monitors does not change the scale. Instead, the app stays at its initial size (always the equivalent of 96 dpi). Same thing happens on Windows 7 with a 125% system scaling (one monitor only): with a regular Windows 7 theme, the app starts scaled with 125%, as expected. When switching Win7 to a "classic" theme (or high-contrast, for that matter), no scaling occurs. A very similar VCL app, also per-monitor-dpi-aware-v2, does scale properly in all situations. It's FMX only. Here's a screenshot of the FMX app on Win10 and Win7: Edited January 25, 2022 by Alexander Halser Share this post Link to post
Alexander Halser 26 Posted January 26, 2022 Update: it is/was a known problem at Embarcadero and the bug has obviously been fixed with Delphi 11. Thread closed. Share this post Link to post