-
Notifications
You must be signed in to change notification settings - Fork 8
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
DPI Awareness Issue on Windows #20
Comments
I think fixing this is a matter of passing |
@AnotherCommander I tried changing my Windows scaling and it change the size of everything. I am not quite sure what is expected to happen here? The default window is 1600x900 and obviously fits easily on my 2560x1440 screen. If I set to 125% (or whatever), I end up with the game window nearly filling my screen. I don't know if that is right or wrong though - everything else goes big too of course. |
@philip-uk The correct and expected behavior is that the window size requested by the application is respected regardless of the DPI scaling. So, what you are seeing is the bug in action - the window should not be filling a larger area when the scaling is increased. To see what it should look like, you can follow the alternative fix method described in my original post on this issue. This should be the behavior by default and this is what both @dgavedissian 's and my proposed fixes do. The former is probably the simplest and quickest, while the latter is the one recommended by Microsoft. ( as seen in https://learn.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process ). |
Addressed by #43 |
@AnotherCommander Please confirm that the DPI is now working for you. |
I will only be able to test in a couple of days - sorry for not being able
to provide feedback earlier, will let you know asap how it goes.
…On Sat, Mar 25, 2023, 11:47 philuk ***@***.***> wrote:
@AnotherCommander <https://github.com/AnotherCommander> Please confirm
that the DPI is now working for you.
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEYHJVZLR62766RZKZ2TJDW525KJANCNFSM6AAAAAAU7VNQEA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Confirming that it works fine now. This issue can be closed. |
I realised that adding I believe the problem is that This flag also doesn't work at all on Windows, which is why the manifest was required there, see: I think on Windows, what's happening is that with the manifest, Windows will no longer do anything except send WM_DPICHANGE events, and I think we are currently ignoring them. That means on HiDPI machines, the window will be exactly 1600x900 and Windows will not scale the window up by 125%/150%/200% (and make the image blurry). However, the engine currently makes no attempt to actually size the window correctly and make sure the GL viewport is correct. It seems that more official support was merged in libsdl-org/SDL#5778 which has a new SDL_WINDOWS_DPI_SCALING window flag. I think I'm going to re-open this issue, remove the
|
Distributed version 0.002 is currently not DPI aware and will generate a wrong size window on startup, depending on the scaling set in Windows.
This is easily fixable by adding this manifest in a resource file:
Declare in resource file as
1 24 "lt64.exe.manifest"
where lt64.exe.manifest is the file containing the earlier posted manifest contents.
Alternatively, this is fixable by right clicking on the lt64.exe -> Properties -> Compatibility tab -> Change high DPI settings -> Check High DPI scaling override, then OK everything. Of course the second method requires user interaction, while the first is fix-and-forget.
The text was updated successfully, but these errors were encountered: