Skip to content

Fix/window icon region selector#5

Merged
tpikachu merged 4 commits into
masterfrom
fix/window-icon-region-selector
Jun 23, 2026
Merged

Fix/window icon region selector#5
tpikachu merged 4 commits into
masterfrom
fix/window-icon-region-selector

Conversation

@tpikachu

Copy link
Copy Markdown
Owner

No description provided.

tpikachu and others added 4 commits June 23, 2026 03:33
- Window icon: add appIcon.ts (appIconPath/appIconImage); set the main window's
  icon so it's the BrainCue icon, not the default Electron one. Tray reuses it.
- Region selector: create with show:false and reveal on ready-to-show (+ fallback)
  so it never flashes/sticks as a blank black window; on reveal re-assert
  always-on-top + moveTop + focus (a global-shortcut trigger isn't foreground).
- Add a main-process Escape (before-input-event) so the selector can ALWAYS be
  cancelled even if the renderer fails to load — fixes the stuck always-on-top
  window that blocked all other windows.
- Capture: log diagnostics (source/display/size/empty) and throw a clear error on
  an empty capture, so a failed grab surfaces instead of opening a blank selector.
- main.tsx: selection window body is opaque (matches the opaque window), removing
  the stale transparent assumption.

No version bump / changelog (release is user-controlled).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diagnosis: desktopCapturer captures fine every time (never black) — the "blank
screen" after the AI finishes an answer is the selector window opening BEHIND the
user's active window. After a solve the overlay was foreground, so opening the
selector from a non-foreground state fails to raise it.

Fix: on reveal, app.focus({steal:true}) to defeat the Windows foreground lock,
plus re-assert always-on-top + moveTop + focus.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Live debugging showed the "blank selector" was the selector window's React UI
failing to load: creating the window on demand right after a GPU-heavy screen
capture made loadURL fail against the dev server ("renderer dev server not ready
…?view=selection"), so the reveal timeout showed an on-top, focused, but empty
black window. Capture itself was always fine (avgBrightness ~31).

Fix: pre-create the selection window at startup (hidden) and reuse it, like the
overlay (which loads reliably). openSelector now captures, pushes the frame via a
new selection:reset event + resets the renderer's drag state, repositions to the
cursor's display, and shows; closeSelector hides instead of destroying. Keeps the
foreground-steal, main-process Esc safety, and capture diagnostics. User-confirmed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Minimum vs. recommended hardware/OS, plus notes on Privacy Mode (Win10 2004+),
macOS system-audio capture, and the hybrid-GPU --disable-gpu escape hatch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tpikachu tpikachu merged commit b70d154 into master Jun 23, 2026
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