Skip to content

Log page focus, page visibility and window occlusion around a blur-cancelled page's keyboard return - #619

Merged
yansfil merged 1 commit into
mainfrom
diag/511-focus-log
Oct 6, 2026
Merged

yansfil merged 1 commit into
mainfrom
diag/511-focus-log

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Part of #511

Summary

main ae3fdf6d의 desktop e2e에서 area cycle native가 browser.spec.ts:857에서 두 시도 모두 실패했습니다(run 37416777424).
#598의 host log로는 누가 page의 keyboard를 가져갔는지 정할 수 없어, 그 빈칸을 채우는 log만 더합니다. 동작은 바뀌지 않습니다.

  • 재시도: window_return page_focused:true 29 ms 뒤 page_blur, 그 뒤 shell_focus가 없습니다. 다른 page의 focus는 log가 없어 그 page인지, page가 숨겨져 응답자를 잃은 것인지 구별되지 않습니다.
  • 첫 시도: window가 돌아올 때 page가 가려진 채(page_visible:false)였고 5초 동안 page를 다시 보이게 하는 sync가 없었습니다.
    • Electron 44.4.5는 macOS가 window를 안 보인다고 알리면 shell에 WasOccluded()를 직접 부르고, 이 길은 --disable-backgrounding-occluded-windows를 거치지 않습니다. 그동안 shell은 frame을 그리지 않아 sync를 보내지 않습니다. 지금 log에는 이 상태가 없습니다.
  • 더한 event(desktop/src/main/browser.ts):
    • browser.page_focus: display id, 빚진 page인지(owed_page), 보이는지, window가 key인지, 빚이 남았는지.
    • browser.page_visible: page가 보이거나 숨는 전환마다, display id와 빚진 page인지, hold를 시작한 page인지.
    • browser.window_visible: window의 show/hide(macOS의 occlusion 알림 포함).
    • 기존 page_blur, window_blur, window_return에 display id(page_blur에는 owed_page, visible도)를 더했습니다.
  • docs/BROWSER_DISPLAYS.md: 이 log가 무엇을 남기는지 같은 말로 고쳤습니다.

Review

  • 조심해서 볼 파일: desktop/src/main/browser.ts - focus/blur/show/hide listener 안의 log.event뿐입니다.
  • 비용 검토: 모든 event는 운영자가 window나 page를 focus하거나, 덮거나, 바꾸는 빈도로만 납니다.
    • page_visible은 show()가 실제로 바뀔 때만 찍습니다(같은 값이면 그 전에 return). tab 전환, layer 열고 닫기, Workspace 전환, drag 시작과 끝에 page마다 한 번입니다. frame이나 keystroke마다 나지 않습니다.
    • URL, title, page 내용은 없습니다. display id는 core가 매기는 id입니다.

Evidence

  • 확인한 것: verify-web.sh desktop typecheck, desktop lint, desktop test(157 통과) 통과.
  • 확인하지 못한 것: 이 event가 실패를 설명하는지는 아직 모릅니다. TEMP 증거 PR(머지 안 함)에서 이 spec만 macOS runner 하나로 반복해 확인합니다.
  • 확인하지 못한 것: @needs-focus spec은 운영자의 화면과 keyboard를 쓰므로 로컬에서 돌리지 않았습니다.

…ncelled page's keyboard return

Part of #511. The host logged only the owed page's payment, the page's blur and the shell's focus, so a page that lost the keyboard to another page, to its own hiding, or a shell that sent no sync while macOS reported the window hidden left no trace. Each event carries the display id and state flags, never an address.
@yansfil
yansfil merged commit b7949aa into main Oct 6, 2026
13 checks passed
@yansfil
yansfil deleted the diag/511-focus-log branch October 6, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant