Skip to content
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

Scale problem with high screen resolution (2k, 4k) #22

Open
TheJustLink opened this issue Dec 27, 2021 · 7 comments
Open

Scale problem with high screen resolution (2k, 4k) #22

TheJustLink opened this issue Dec 27, 2021 · 7 comments
Labels
good first issue Good for newcomers

Comments

@TheJustLink
Copy link

TheJustLink commented Dec 27, 2021

I use high DPI setting in app compatibility properties.


All icons small.

And this:

It is 0% load for GPU1/GPU2/CPU.

In original version, all icons have normal size, but tray icons not.

@pgrawehr
Copy link
Collaborator

pgrawehr commented Jan 3, 2022

I'm unfortunately unable to reproduce this issue. It looks all well for me, even with a high DPI setting. Which version did you try?

@TheJustLink
Copy link
Author

I'm unfortunately unable to reproduce this issue. It looks all well for me, even with a high DPI setting. Which version did you try?

I use Release 0.9.7-alpha11.

If don't override the DPI in app settings, the quality will be low:
app
tray

@pgrawehr
Copy link
Collaborator

pgrawehr commented Jan 5, 2022

You mean that the font is blurred? Yes, I have seen that, too. I have a clue on what causes this, but currently not much of an idea on how to avoid it. This needs investigating.

@pgrawehr pgrawehr added the good first issue Good for newcomers label Jan 5, 2022
@gym404
Copy link

gym404 commented May 7, 2022

I think it's a common windows problem nowdays: https://blogs.windows.com/windowsdeveloper/2017/05/19/improving-high-dpi-experience-gdi-based-desktop-apps/

@T-Troll
Copy link

T-Troll commented Aug 14, 2022

@pgrawehr here is how i fix it (as well as wrong scaling then app window moved to other scale monitor) in my tools:

void ResetDPIScale() {
	HKEY dpiKey;
	if (RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers"),
		0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &dpiKey, NULL) == ERROR_SUCCESS) {
		char pathBuffer[2048];
		GetModuleFileNameA(NULL, pathBuffer, 2047);
		const char setValue[] = "~ GDIDPISCALING DPIUNAWARE";
		RegSetValueEx(dpiKey, pathBuffer, 0, REG_SZ, (byte*)setValue, (DWORD)strlen(setValue));
		RegCloseKey(dpiKey);
	}
}

@pgrawehr
Copy link
Collaborator

That's quite a hack, by just disabling DPI scaling for the application from the operating system. There must be a setting in WinForms to fix this as well, however scaling is implemented quite sub-optimaly there. I just didn't have time to look into that so far.

@T-Troll
Copy link

T-Troll commented Aug 14, 2022

Yes, a kind of hack.

I don't use WinForms/MFC, plain C instead, and this is the only way to make it work correctly (both set DPI Aware/DPI Unaware just add some other issues).
And this is the bug fix for issue "Windows add incorrect scaling settings then create app".

BTW, topic starter case is not worst - try to open app window at low-DPI monitor then move it to high-DPI. It will be a real pain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants