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

No monitor physical dimensions on MacOS #84

Open
JC3 opened this issue Nov 12, 2023 · 3 comments
Open

No monitor physical dimensions on MacOS #84

JC3 opened this issue Nov 12, 2023 · 3 comments

Comments

@JC3
Copy link

JC3 commented Nov 12, 2023

On MacOS 13.5, the height_mm and width_mm fields of the monitor info are reported as None.

I saw that you're not doing OSX dev; but I figured I'd throw this here to track the issue anyways.

@JC3
Copy link
Author

JC3 commented Nov 12, 2023

Maybe some helpful soul will shed some light on a solution at https://stackoverflow.com/questions/77469944/getting-physical-dimensions-of-screen-in-macos.

@JC3
Copy link
Author

JC3 commented Nov 12, 2023

@JC3
Copy link
Author

JC3 commented Nov 12, 2023

Can confirm above gist works; tested getting it on macOS 13.5 given an NSScreen like this:

screen = NSScreen.screens()[index]
number = screen.deviceDescription()["NSScreenNumber"]
width_mm, height_mm = CGDisplayScreenSize(number)

Will try to make a PR.

It does introduce an extra dependency on pyobjc-framework-Quartz on macOS but I don't think that is a problem.

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

No branches or pull requests

1 participant