-
-
Notifications
You must be signed in to change notification settings - Fork 746
Incorrect mouse position likely due to high DPI display #1241
Comments
Thats my bad haha. Normally, screen size should be the physical pixel size. Are you getting this value from ScreenDimensions? |
I can actually confirm this as well. My mouse gets higher values than what the I assume the problem lies in the resource and not the input. |
Yeah the window size came from |
I actually tested this and it was working just fine on my hidpi setup when we released. |
Not sure if relevant, but may be. |
The screen dimensions are correct for me tho. They are the values I have in my |
Mine aren't due to Wayland (unless that's the problem). The problem of mine happens in fullscreen so there is no border and i guess the dimesnions should be the same as the screen resolution. |
Did some more testing on a different device and it here it seems the window size isn't accurate. It's set to 1280x720 in the |
We are using the physical size returned by winit instead of converting it to logical size like before. On a 4k monitor with a dpi setting making my resolution 1080p, making the window fullscreen would return the 4k screen size, which was the intended result. Tested on wayland and xorg. We got people that tested it on both windows and mac too. Its possible that when creating the window it is the wrong size, as I might have forgot to update the init code for the window. Is this what you are observing? |
The dpi setting is in ScreenDimensions by the way, if you can check what the value is. |
Ah, I see. So is there a way to either get the logical mouse position or the physical window size (without multiplying it by the HDPI factor)? |
Normally you should be getting the physical mouse position as well as the physical window size. I'll test on my laptop(hidpi) to make sure the results are valid. |
Okay its clearly broken again for some reason... |
Hello, can you test this and confirm if it works for you? Thanks! #1246 |
Yes, it does! |
1243: Removed unnecessary code. r=Xaeroxe,jojolepro ,TimonPost a=TimonPost Removed some unnecessary code. 1246: Fix reported ScreenDimension and wrong DisplayConfig sizes. r=happenslol,azriel91,udoprog a=jojolepro fixes #1241 1248: Add example Ron configs to docs r=Xaeroxe ,LucioFranco ,jojolepro udoprog ,azriel91 a=Sogomn Co-authored-by: Timon <timonpost@hotmail.nl> Co-authored-by: Joël Lupien (Jojolepro) <jojolepromain@gmail.com> Co-authored-by: Johannes Boczek <johannes.boczek@web.de>
Hello! I think I've been hitting exactly this same issue. When using my large monitor, I see this in the logs:
And then the mouse position gets "out of sync" with the actual position on the screen by exactly this factor. So I have a question: is the DPI scaling supposed to be transparent to us users when acessing mouse positions?
|
InputHandler::mouse_position
seems to return incorrect values on displays with high DPI.The "Screen" size in the image is the window size. Top left of the window is still (0, 0) but the mouse position can be greater than the window bounds without leaving the window.
Occurs on a 3840x2160 28" (~157 DPI) monitor but only recently (since 0.10).
The text was updated successfully, but these errors were encountered: