Skip to content

MacosScreenAccessor doesn't seem to work #3

@ychin

Description

@ychin

I have been playing with MacosScreenAccessor and I can't get it to work for me. Just for reference, I'm using an M1 MacBook Pro with Retina display, so I'm wondering if display scaling is wrong but I played around with it a little but couldn't get it to work. It wouldn't detect the change after the initial addition and deltion.

Looking at the implementation, I do wonder if we could just use the Java AWT implementation. I saw that you forked the project to add a Mac-specific implementation, but looking at OpenJDK's implementation I think they are using basically the same APIs (CGWindowListCreateImage) (https://github.com/openjdk/jdk/blob/50120396b6cca1219fb5dd42a11e4b29b79bd3bd/src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m#L315) so in theory the AWT version is "native".

I do wonder if we could use ScreenCaptureKit though, which is a much newer API and is supposed to give much lower access to do screen capture (but only available on macOS 13). I actually wonder if too-low-level of access would skew the result if it bypasses the final window composition. Incidentally, OBS also moved from CGWindowListCreateImageto using ScreenCaptureKit (obsproject/obs-studio#5875).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions