# gpui_macos: Migrate screen capture to \`objc2\` \(\#64251\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/4b47ceb9d328035bde5ef99009e674d9fee07fb7)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 4b47ceb9d328035bde5ef99009e674d9fee07fb7

Requested commit: 4b47ceb9d328035bde5ef99009e674d9fee07fb7

Commit: 4b47ceb9d328035bde5ef99009e674d9fee07fb7

Tree: 40a882096a3a5f89cb6d433973bed00e99fb9d1a

Author: tidely

Committer: GitHub

## Message

```
gpui_macos: Migrate screen capture to `objc2` (#64251)

# Objective

Get rid of instances of the `block` crate, as it will not compile in a
future version of Rust. This gets rid of the `block` crate inside of
`gpui_macos`, which means were on the home stretch.

## Solution

Migrate `screen_capture.rs` completely to `objc2`. While a more targeted
fix is theoretically possible, there were enough upsides where I thought
this was worth a full migration.

Completely gets rid of the `media` crate, which had manual bindings to
`core_media`, which `objc2` can provide. Gets rid of tons of unsafe
code, and a lot of code in general.

## Testing

Tested manual sharing inside of a Zed channel

Release Notes:

- N/A
- [GPUI] Migrated macOS screen capture to `objc2`
```

## Parents

- [7a01ac15c5f69e86d66af641a835fa85fdfb0d06](https://git.cafe/gitcafe/zed/commit/7a01ac15c5f69e86d66af641a835fa85fdfb0d06?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/4b47ceb9d328035bde5ef99009e674d9fee07fb7?format=markdown)
