Skip to content

Conversation

@cwarden
Copy link
Contributor

@cwarden cwarden commented Jun 23, 2025

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.

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.
cwarden added a commit to cwarden/fyne that referenced this pull request Jun 23, 2025
…r Boundaries"

This reverts commit 98a7de0.

Replaced by a simpler solution in fyne-io#5802.
Copy link
Member

@andydotxyz andydotxyz left a 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.

@cwarden
Copy link
Contributor Author

cwarden commented Jun 24, 2025

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.

2025-06-24-075739_985x263_scrot

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).

@cwarden
Copy link
Contributor Author

cwarden commented Jun 24, 2025

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.

2025-06-24-075739_985x263_scrot

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.)

@coveralls
Copy link

coveralls commented Jul 4, 2025

Coverage Status

coverage: 62.401% (+0.09%) from 62.31%
when pulling fc67f02 on cwarden:monitor-detection
into abab0ab on fyne-io:develop.

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much!

@andydotxyz andydotxyz merged commit 15a3b96 into fyne-io:develop Jul 11, 2025
10 of 11 checks passed
@andydotxyz
Copy link
Member

Thanks so much @cwarden and congratulations on landing your first Fyne code contribution :)

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.

3 participants