Skip to content

Add presentation detection; fix break overlay input handling#3

Open
phalox wants to merge 1 commit intocheat2001:mainfrom
phalox:feat/overlay-input-fix-presentation-detector
Open

Add presentation detection; fix break overlay input handling#3
phalox wants to merge 1 commit intocheat2001:mainfrom
phalox:feat/overlay-input-fix-presentation-detector

Conversation

@phalox
Copy link
Copy Markdown

@phalox phalox commented Mar 25, 2026

Summary

This PR would solve #2

  • Presentation detection: automatically pauses the break timer when the user is screen sharing or watching media (PresentationDetector polls CGDisplayStream/NSWorkspace). Resumes when the session ends. Two new settings added: Pause When Screen Sharing and Pause When Watching Media (both on by default).
  • Overlay input fixes: overrides sendEvent so the first click always dismisses without a double-click; reclaims key-window focus after Cmd+Tab via resignKey + a NSWorkspace.didActivateApplicationNotification observer (backs off while the Dock/app-switcher owns the keyboard); intercepts cursorUpdate to keep the arrow cursor over text.
  • Misc: OSLog added to pause/resume calls; macOS 15 symbolEffect guarded behind #available; empty error-handler closures removed.

Test plan

  • Screen sharing (Zoom/Teams/Slack) pauses the timer; ending the call resumes it
  • Playing a video (YouTube/VLC) pauses the timer; stopping resumes it
  • Both new toggles in Settings → General reflect the behaviour
  • Break overlay dismisses on first click (no double-click needed)
  • ESC dismisses the overlay after Cmd+Tab to another app
  • Cmd+Tab app-switcher navigation is not disrupted while the overlay is showing
  • Cursor shows as arrow (not I-beam) when hovering over text on the overlay

🤖 Generated with Claude Code

Pause the break timer automatically when the user is screen sharing or
watching media. PresentationDetector polls CGDisplayStream and NSWorkspace
to detect active sessions; resumes when the session ends. Two new settings
(pauseWhenSharing, pauseWhenWatchingMedia) are exposed in GeneralSettingsView.
OSLog added to pause/resume calls for easier debugging.

Overlay input fixes: override sendEvent to dismiss on first click without
double-click; reclaim key-window focus after Cmd+Tab via resignKey + a
NSWorkspace observer (skips reclaim while Dock/app-switcher owns the
keyboard); intercept cursorUpdate to keep the arrow cursor over text.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@phalox
Copy link
Copy Markdown
Author

phalox commented Mar 25, 2026

Logs while screensharing:

log stream --predicate 'subsystem == "com.eyebreak.app"' --level info --style compact
Filtering the log data using "subsystem == "com.eyebreak.app""
Timestamp Ty Process[PID:TID]
2026-03-25 01:29:00.711 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Share indicator matched — app: Microsoft Teams, layer: 2147483631, window:
2026-03-25 01:29:00.711 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Pause triggered: screen-share indicator window found
2026-03-25 01:29:00.711 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Presentation state changed: started
2026-03-25 01:29:00.722 I Eyebreak_t[71815:11de214] [com.eyebreak.app:BreakTimerManager] Timer paused — reason: presenting, state: working(remainingSeconds: 535)
2026-03-25 01:29:05.691 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Share indicator matched — app: Microsoft Teams, layer: 2147483631, window:
2026-03-25 01:29:05.691 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Pause triggered: screen-share indicator window found
2026-03-25 01:29:10.691 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Share indicator matched — app: Microsoft Teams, layer: 2147483631, window:
2026-03-25 01:29:10.691 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Pause triggered: screen-share indicator window found
2026-03-25 01:29:15.709 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Share indicator matched — app: Microsoft Teams, layer: 2147483631, window:
2026-03-25 01:29:15.709 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Pause triggered: screen-share indicator window found
2026-03-25 01:29:20.709 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Share indicator matched — app: Microsoft Teams, layer: 2147483631, window:
2026-03-25 01:29:20.709 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Pause triggered: screen-share indicator window found
2026-03-25 01:29:25.728 I Eyebreak_t[71815:11de214] [com.eyebreak.app:PresentationDetector] Presentation state changed: ended
2026-03-25 01:29:25.728 I Eyebreak_t[71815:11de214] [com.eyebreak.app:BreakTimerManager] Timer resumed — reason: presentation ended

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