Skip to content

Fixed Retina detection for mirrored monitors#58

Open
excitoon wants to merge 1 commit into
drov0:masterfrom
excitoon:patch-1
Open

Fixed Retina detection for mirrored monitors#58
excitoon wants to merge 1 commit into
drov0:masterfrom
excitoon:patch-1

Conversation

@excitoon

@excitoon excitoon commented May 6, 2025

Copy link
Copy Markdown

Progress on #53 (fixes some cases)

@excitoon excitoon changed the title Fixed Retina detection for mirrorred monitors Fixed Retina detection for mirrored monitors May 6, 2025
@drov0

drov0 commented May 8, 2025

Copy link
Copy Markdown
Owner

Hi ! Thanks for your contribution, I'm sorry I didn't catch the mss issue I don't own a mac. Is there a way to detect retina without calling a subprocess ? I'm not a big fan of calling external processes (because with some aliasing you could have the lib call a different binary and it's a security issue)

@excitoon

excitoon commented Jun 6, 2025

Copy link
Copy Markdown
Author

@drov0 actually it's quite worse than that, you can have one Retina monitor and one regular. I guess you need to design an API for multi-monitor setups for a start 🤷‍♂️

@excitoon

excitoon commented Jun 6, 2025

Copy link
Copy Markdown
Author
>>> import AppKit
>>> [(s.backingScaleFactor(), s.frame().size, s.frame().origin) for s in AppKit.NSScreen.screens()]
[(1.0, <CoreFoundation.CGSize width=3840.0 height=1080.0>, <CoreFoundation.CGPoint x=0.0 y=0.0>)]

I had to restart Python to get changes :( (however, the current solution has the same issue):

>>> import AppKit
>>> [(s.backingScaleFactor(), s.frame().size, s.frame().origin) for s in AppKit.NSScreen.screens()]
[(2.0, <CoreFoundation.CGSize width=1512.0 height=982.0>, <CoreFoundation.CGPoint x=0.0 y=0.0>)]

@excitoon

excitoon commented Jun 6, 2025

Copy link
Copy Markdown
Author

https://stackoverflow.com/a/69637863

Basically, we need some approach how to integrate this code into the library, unfortunately.

@excitoon

excitoon commented Jun 6, 2025

Copy link
Copy Markdown
Author

Personally, I would stick to polling separate processes, with Python or not (for example, you can have some manual update method).

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