Alexander Halser 32 Posted Tuesday at 08:40 AM (edited) I've run into a new problem that did not occur to me before. And the reason is that I purchased a new monitor with a somewhat higher resolution. To compensate for that, I have switched the Windows system DPI from 96 to 120. Delphi is running with 120 dpi as well, form designer, too. The symptom: When a TFrame gets created at runtime and is docked into another form, the first re-scaling of the frame content upon a monitor change is wrong. How to reproduce: 1) Delphi XE 11.3 2) Main monitor has a system scaling of 125% (= 120 dpi) 3) IDE is running at 120 dpi 4) The app starts on the main monitor first (no scale required, because design and runtime dpi are both 120) 5) Form is moved to a different monitor with a higher dpi Screenshots and project source below. Source of the problem: When examining the internal ChangeScale(M, D, isdpichange) messages, it becomes clear that all TControls (but not the TFrame itself) receive one initial scaling message, that scales to 192 dpi from 96 dpi. This is wrong, because the control currently has a CurrentPPI of 120. As a result, the controls over-scale at the first monitor change. Questions: Could anyone please test if this bug has been fixed in Delphi 12? I am in the middle of substantial code changes with a pretty large application and am reluctant to change horses in the middle of the race. If the problem persists in Delphi XE 12, updating the IDE would be an additional effort that I would like to avoid at this point. Project2.zip Edited Tuesday at 08:44 AM by Alexander Halser Share this post Link to post
Vandrovnik 222 Posted Tuesday at 09:20 AM For me, the only way to handle all HDPI related problems and bugs, is to use Delphi in DPI-unaware mode and keep all designed forms and frames at 96 dpi. On runtime they scale fine. Even then Delphi IDE 12.3 on monitor set to 150 % sometimes shows hint too small and moved to top left corner of the screen... Share this post Link to post
Alexander Halser 32 Posted Tuesday at 09:47 AM Quote use Delphi in DPI-unaware mode It's a pain, I know. Initially I tried your approach, but then the IDE is fuzzy. Writing code in a fuzzy editor is an even bigger pain. Actually, it has its benefits to develop forms at 120 dpi or even higher. You are less likely to run into runtime scaling problems with labels a tad too short or checkboxes and radio buttons not tall enough to fit the descent of characters like "g" or "y". It's not bad to develop at 120 dpi and there are normally no scaling problems. Unless you go per-monitor-dpi-aware, of course Share this post Link to post
Uwe Raabe 2156 Posted Tuesday at 11:43 AM There are several bugs fixed in 12.2 and 12.3 affecting frames. https://quality.embarcadero.com/browse/RSP-37402 https://quality.embarcadero.com/browse/RSP-39847 https://quality.embarcadero.com/browse/RSP-40110 https://quality.embarcadero.com/browse/RSP-43560 https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-1020 Perhaps these will fix your problem, too. I will test your project later when I've found some time to configure my system for monitors with different dpi. 2 Share this post Link to post
Typer2 0 Posted Tuesday at 12:53 PM I have scaling of 200% and unfortunately I am also forced to run Delphi in DPI-unaware mode. Otherwise TFrame and a couple of other components have several properties scaled incorrectly and every time I edit the DFM it doubles some values. Share this post Link to post