-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Use Scaled Monitor Size For Monitor Detection #5802
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
Conversation
Fix monitor detection by using the candidate monitor's scaled dimensions. Fixes bug in which scale changes prematurely as window gets near monitor with a different scale.
…r Boundaries" This reverts commit 98a7de0. Replaced by a simpler solution in fyne-io#5802.
andydotxyz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. A comment inline about a potential tidy.
However a larger question... what are the return units?
We usually use int for pixels only but this is no longer a pixel size I don't think.
If it is back to regular Fyne coordinates then float32 is what we use.
It is pixels. Here's layout I'm using where I ran into the issue. The monitor on the left has a native resolution of 2560x1600, which is scaled to 1920x1200, the ~1.6 scaling. So the function should return (1920, 1200) for the first monitor. The other two are not scaled so it returns their native resolutions of (2560, 1440). |
Hmm, it's actually not returning (1920, 1200), but (1625, 1015). So I think you're right that these are Fyne coordinates. (My mental model of Fyne's scaling is clearly still incomplete.) |
andydotxyz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much!
|
Thanks so much @cwarden and congratulations on landing your first Fyne code contribution :) |


Fix monitor detection by using the candidate monitor's scaled
dimensions.
Fixes bug in which scale changes prematurely as window gets near monitor with a different scale.