Skip to content

Settings toggle to allow screen capture of the main window - #147

Merged
kevinkamto merged 7 commits into
mainfrom
feat/allow-screen-capture-setting
Nov 5, 2026
Merged

kevinkamto merged 7 commits into
mainfrom
feat/allow-screen-capture-setting

Conversation

@kevinkamto

@kevinkamto kevinkamto commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • New allowScreenCapture setting, off by default, with a checkbox on the configuration page (EN/RU).
  • Content protection is now applied in applySurfaceVisibility() instead of once at window creation, so the toggle takes effect immediately with no restart.
  • Effective protection is stealth || own capture in progress || !(allowScreenCapture || --disable-content-protection). Stealth always hides the window, whatever the setting says.
  • setContentProtection is only called when the value changes, so window show/restore events don't make extra shell calls.
  • The app's own action-suggestion screenshot runs through withContentProtection(). With capture allowed, the window would otherwise appear in that image, where it can cover the question and show the model its own earlier answers. Protection is switched on for the capture, with a 100ms wait (CAPTURE_PROTECTION_SETTLE_MS) only when it actually had to switch, and the setting is restored afterwards.

Test plan

  • pnpm lint, both tsc configs, vite build, pnpm test:main
  • New test/content-protection.test.mjs: protected by default, toggle lifts it, no-op skipped, stealth re-protects, leaving stealth returns to the setting, own capture protects and restores (including on failure), no-op on an already protected window
  • test/config-store.test.mjs: allowScreenCapture defaults to off
  • Manual: toggle on in Configuration, window shows in a screen share without restart; enter stealth mid-session, hidden; leave stealth, visible again
  • Manual: with the toggle on, take an action-suggestion screenshot and confirm the app window is not in the image

🤖 Generated with Claude Code

alpha5611331 and others added 4 commits November 5, 2026 13:43
Content protection stays the default; capture is an opt-out the user
has to choose. Backfilled on upgrade like hideTaskbarWhileRunning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Protection is now owned by applySurfaceVisibility instead of being set
once at window creation, so the setting applies without a restart and
stealth always protects, whatever the setting says. Only real changes
reach setContentProtection. --disable-content-protection still forces
capture outside stealth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Gitar is working

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

Gitar

alpha5611331 and others added 3 commits November 5, 2026 13:53
With screen capture allowed, the action-suggestion screenshot included
the app window, which can cover the question and feeds the model its
own earlier answers. The capture now runs with the window protected,
waiting one composition when protection had to be switched on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pt-out

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kevinkamto
kevinkamto merged commit 101ae83 into main Nov 5, 2026
1 check passed
@alpha5611331
alpha5611331 deleted the feat/allow-screen-capture-setting branch November 5, 2026 20:04

@kevinkamto kevinkamto left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

2 participants