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 getPixelScaleFactor #198

Conversation

JL2210
Copy link

@JL2210 JL2210 commented Sep 1, 2024

Previous implementation was broken on hidpi platforms where the
size of the framebuffer and the size of the window correlate 1:1.
This manifested in the mouse code thinking the mouse was in a
different location than it actually was.

New implementation explicitly calculates the ratio between the
framebuffer size and the window size, rather than relying on
glfwGetWindowContentScale.

Tested on X11 and Wayland, should work on Windows

Still a minor issue of the screen not resizing properly after exiting fullscreen but the mouse still works

@JL2210 JL2210 marked this pull request as ready for review September 1, 2024 18:02
@JL2210
Copy link
Author

JL2210 commented Sep 1, 2024

Ready for review

@JL2210 JL2210 changed the title Fix mouse handling Fix getPixelScaleFactor Sep 1, 2024
@kappa-maintainer kappa-maintainer merged commit b132d86 into CleanroomMC:experimental/foundation Sep 2, 2024
1 check passed
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