Skip to content

Conversation

@FischLu
Copy link
Contributor

@FischLu FischLu commented Nov 2, 2024

fix #11288, The CGDisplayStreamCreate function has been deprecated and the current code fails to compile on macOS 15 and above. Following Apple's official recommendations, this fix replaces CGDisplayStreamCreate with ScreenCaptureKit (MacOS 12.3+). Since ScreenCaptureKit is an asynchronous framework, necessary semaphore waiting has been added to the code. This change successfully triggers the screen recording permission request dialog and allows proper use of autotype when permission is granted. The code has been tested and confirmed working on macOS 15.0.1.

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

@droidmonkey
Copy link
Member

droidmonkey commented Nov 2, 2024

Omg thank you, I really didn't want to figure this one out.

@droidmonkey droidmonkey added this to the v2.7.10 milestone Nov 2, 2024
@droidmonkey droidmonkey changed the title fix #11288 Replace legacy code on macOS builds Nov 2, 2024
@FischLu
Copy link
Contributor Author

FischLu commented Nov 4, 2024

After adding Q_UNUSED(error), the automated tests do not pass. You may check the reason.

@droidmonkey
Copy link
Member

The failures are ephermal and unrelated

@droidmonkey droidmonkey merged commit ca9b88f into keepassxreboot:develop Nov 10, 2024
11 checks passed
@TheRojam
Copy link

Thank you guys!

alissonperez pushed a commit to alissonperez/keepassxc that referenced this pull request Nov 20, 2024
* Fix macOS build error due to CGDisplayStreamCreate being deprecated.

---------

Co-authored-by: FischLu <[email protected]>
@phoerious phoerious added pr: bugfix Pull request fixes a bug and removed bug labels Nov 22, 2024
@droidmonkey droidmonkey added the pr: backported Pull request backported to previous release label Dec 22, 2024
droidmonkey added a commit that referenced this pull request Dec 22, 2024
* Fix macOS build error due to CGDisplayStreamCreate being deprecated.

---------

Co-authored-by: FischLu <[email protected]>
pull bot pushed a commit to Graysonbarton/keepassxc that referenced this pull request Jan 26, 2025
* Fix macOS build error due to CGDisplayStreamCreate being deprecated.

---------

Co-authored-by: FischLu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

high priority 🚨 platform: macOS pr: backported Pull request backported to previous release pr: bugfix Pull request fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed build on macOS with Xcode 16.0

5 participants