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

Fix WM_DPICHANGED not triggering Resized event #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

robbert-vdh
Copy link
Member

The window size gets changed directly in the WM_DPICHANGED handler, so comparing the new size against that will not work. The solution is to store the last size seen in WM_SIZE separately.

This fixes a regression from #136 affecting HiDPI displays+system scaling on Windows. @geom3trik was going to test this fix at some point, but everyone's forgotten about it since then and I just remembered that it still hasn't been fixed. I don't have a Windows HiDPI setup so I haven't tested this myself, but it should at least fix the WindowEvent::Resized not coming through when the system DPI changes. @geom3trik could you test this?

The window size gets changed directly in the `WM_DPICHANGED` handler, so
comparing the new size against that will not work. The solution is to
store the last size seen in `WM_SIZE` separately.
@geom3trik
Copy link
Contributor

Tested this on my machine (Windows 11) and it works as expected.

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

Successfully merging this pull request may close these issues.

2 participants