Repository navigation
macOS: 用 screencapture 实现真实截屏 - #2
Conversation
macOS returned `generate_fallback_capture`, a generated grid, so the snip flow captured nothing on that platform. - `screen::capture_via_screencapture` runs `/usr/sbin/screencapture -x -t png` and reads the result back as a data URL. It needs the Screen Recording permission; a denied permission surfaces as an error, not a silent empty image. - `capture_screen` on macOS reports the image as the main display at (0,0). Multi-display Macs capture the main display only, and the doc comment says so. - The non-Linux snip branch now emits the same `capture`/`monitor` payload as Linux and reports the mapped window rect after `show`, so the frontend's 1:1 crop works when the compositor shrinks the overlay (macOS keeps the menu bar strip free). Also record the executable bit on `scripts/*.sh`. `core.fileMode` is false in this checkout, so the bits were never committed and a fresh clone could not run `./scripts/check.sh`. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41724caddd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
`screencapture` exits 0 without Screen Recording permission and returns an image of the desktop wallpaper. The PNG header check cannot tell that apart from a real capture, so the snip UI could submit the wallpaper with no error. Call `CGPreflightScreenCaptureAccess` first and return a distinct `PermissionDenied` error naming the System Settings pane. The framework call is the only FFI here: one function, no pointers. Co-Authored-By: Claude Code <noreply@anthropic.com>
概述
macOS 的截屏此前返回
generate_fallback_capture,也就是一张生成的网格图,截屏流程实际拿不到屏幕内容。改动
screen::capture_via_screencapture调用/usr/sbin/screencapture -x -t png,读回文件并编码为 data URL。需要「屏幕录制」权限,权限被拒时返回错误,不会静默给出一张空图。capture_screen返回主显示器截图,原点为 (0,0)。多显示器机器只截主屏,代码注释写明了这一点。capture/monitor载荷,并在show之后回传窗口真实矩形。这样当合成器缩小叠加层时(macOS 会避开菜单栏),前端的 1:1 裁剪仍然对齐。同时补上
scripts/*.sh的可执行位。这个 checkout 的core.fileMode是 false,之前从未提交过该位,新克隆的仓库无法直接运行./scripts/check.sh。验证
./scripts/check.sh通过,包含cargo clippy -p glint-core --target aarch64-apple-darwin。🤖 Generated with Claude Code