macOS 27: native app screenshot captures the window-sharing indicator instead of the app window
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 54/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- macos, swift, typescript
- Domínio
- desktop, testing-qa
Direção de pesquisa
Start with apple/macos-helper/Sources/AgentDeviceMacOSHelper/BackgroundInteraction.swift and trace onScreenWindows, frontWindow, and the screenshot path through AppWindowScreenshot.frontShareableWindow. Check how accessibility windows can be matched to CGWindow entries, then add regression coverage for screenshots and the frontWindowFrame point check. Done means the app’s main window is selected while the sharing indicator is excluded.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Problem
On macOS 27, agent-device screenshot of a native-backend app session returns the app's window-sharing indicator instead of the app's window. The result is a 132x40 PNG (66x20 points at 2x) of a small "Window" panel.
macOS 27 adds a small layer-0 window to the captured app's own process while anything captures one of that app's windows (here a ScreenCaptureKit stream from another process). The helper's frontWindow takes the first eligible layer-0 window of the pid in CGWindowListCopyWindowInfo order, so the indicator wins over the real window.
Expected: the screenshot captures the app's real main window.
Evidence
- macOS 27.0 arm64, agent-device 0.21.31,
AGENT_DEVICE_MACOS_APP_BACKEND=native, app session on a SwiftUI app (bundledev.stim.desktop.development.hosted1), driven through amacos-applease. agent-device snapshot -ilists the indicator before the real window, as anaxdialognamed "Window" whose only child is a button named "WindowSharingSessionButton" (marked[covered]), then the real window:
@e1 [application] "StimDesktop"
@e2 [axdialog] "Window" [covered]
@e3 [button] "WindowSharingSessionButton" [covered]
@e4 [window] "main"
agent-device screenshot out.pngthen reportsout.png (132x40).- The app's windows from
CGWindowListCopyWindowInfo, filtered to its pid (id, layer, onscreen, width, height, title), from an earlier run with the same symptom:
380 0 1 66 20 Window
264 0 1 1100 850 SwiftUI Playground
- The indicator survives stopping and relaunching the app while the capture continues.
Cause
onScreenWindows(pid:windowInfo:) in apple/macos-helper/Sources/AgentDeviceMacOSHelper/BackgroundInteraction.swift keeps every window with layer 0, on screen, alpha above 0 and nonzero bounds, and frontWindow returns .first. The 66x20 indicator satisfies all of those. AppWindowScreenshot.frontShareableWindow then captures it, since ScreenCaptureKit offers it.
Fix idea
Choose the screenshot window from the app's accessibility windows instead of the first layer-0 CGWindow: prefer AXMainWindow or AXFocusedWindow, or a window whose subrole is AXStandardWindow, and match it to a CGWindow by frame or _AXUIElementGetWindow. The indicator is an AXDialog without a standard-window subrole, so it is excluded. A size floor would be a weaker fallback.
The same ordering may affect any command that uses frontWindowFrame, such as the on-screen point check for click/press, so a regression test should cover both.
Related: #3213 (native backend follow-ups, capture-frame contract), #3761.
- Linguagem predominante
- TypeScript
- Estrelas
- 5.2k
- Forks
- 359
- Merge médio
- 13h 37min
- PRs com merge (30d)
- 665
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de callstack/agent-device
-
bug ready-for-agent
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
callstack/agent-device#4112 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
iOS alert wait: the last poll can get ~30 ms and turns "no alert" into a failed readTalvez já em andamento @pcbeingused333 assumiu há 1 dia. Abertabug ready-for-agent
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
callstack/agent-device#4018 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
callstack/agent-device#1869 ·
Mantenedores costumam responder em até 1 dia
-
iOS input fails in 0.21.34+ when Apple tools resolve past a stale Xcode selection symlinkTalvez já em andamento @thymikee assumiu hoje. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 22/100
callstack/agent-device#4145 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 Meio dia Facilidade para iniciantes 48/100
callstack/agent-device#4142 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de callstack/agent-device
Issues semelhantes
-
Dificuldade 2/5 Menos de uma hora Facilidade para iniciantes 86/100
WilliamSmithEdward/xlide_vscode#1564 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
a2ui-project/a2ui#3809 ·
Mantenedores costumam responder em até 2 dias
-
[Bug] A write skipped for exceeding the size limit leaves its finished temp file in the libraryAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
Mantenedores costumam responder em até 4 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
esphome/device-builder-frontend#2064 ·
Mantenedores costumam responder em até 1 dia
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 61/100
lingdojo/kana-dojo#33465 · 1 comentário · 5 reações ·
Mantenedores costumam responder em até 1 dia