New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detecting wrong DPI while switching between monitors #1763
Comments
Same issue here. @ansgarbecker Can you try to hook onto |
ChatGPT says: uses
Winapi.Windows, Shcore;
function GetMonitorDPI: UINT;
var
Monitor: HMONITOR;
DPIX, DPIY: UINT;
begin
// Get handle to the primary monitor
Monitor := MonitorFromWindow(GetDesktopWindow, MONITOR_DEFAULTTOPRIMARY);
// Retrieve DPI of the monitor
GetDpiForMonitor(Monitor, MONITOR_DPI_TYPE_EFFECTIVE, DPIX, DPIY);
Result := DPIX; // You can return DPIY if you need vertical DPI
end;
procedure TForm1.Button1Click(Sender: TObject);
var
DPI: UINT;
begin
// Get DPI of the current monitor
DPI := GetMonitorDPI;
// Display DPI
ShowMessage('DPI: ' + IntToStr(DPI));
end;
|
Using the The wrong percentage shown in the log panel is only cosmetic, and fixed in the next build 6852. Also the wrong height of the donate button in the upper right corner. Please test with the next build available in an hour. Apart from that I cannot reproduce any obvious issue with the newest release, no matter how often I move HeidiSQL from one screen to another. |
So my situation is weird/exotic, but it's like this: I run HeidiSQL on a desktop PC in my office. When I work in the office, I have 2 1080p displays, 100% scaling factor, 96 dpi. When I work at home, I remote (via RDP) into my office PC and continue working. At home I have 2 monitors, one 1080p (100% scaling and one with a higher scaling of 125%). HeidiSQL's controls' scaling gets messed up if I move from one location to the other. |
I have noticed a problem while moving main windows from one monitor to other.
My main monitor have scaling set to 100% and second monitor is on 125%.
When I open HeidiSQL on main monitor in console window I see:
/* Scaling controls to screen DPI: 100% */
And when I then move window to second monitor I see:
/* Scaling controls to screen DPI: 125% */
But when I move window back to the main monitor I got this:
/* Scaling controls to screen DPI: 80% */
It should be 100% not 80%.
Why is this a problem? Because when HeidiSQL starts on second monitor (I don't know why it starts on second monitor because I didn't close it on second monitor, but that is other bug that I will submit later) fonts are small - smaller then how I set them, and when I move window to the main monitor fonts are still small and DPI is set to 80%. Then I must close HeidiSQL on main monitor for it to start it again on main monitor to bring back original font size.
My HeidiSQL version is: 12.3.0.6589 (64bit).
My Windows is: Windows 10, version 22H2 (OS Build 19045.2486)
Please fix this.
The text was updated successfully, but these errors were encountered: