Skip to content

fix(chromium-headful): refocus live view on mouse down - #337

Merged
masnwilliams merged 3 commits into
mainfrom
hypeship/focus-live-view-on-click
Aug 18, 2026
Merged

fix(chromium-headful): refocus live view on mouse down#337
masnwilliams merged 3 commits into
mainfrom
hypeship/focus-live-view-on-click

Conversation

@masnwilliams

@masnwilliamsmasnwilliams commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

summary

  • restore keyboard focus to the live-view overlay on desktop mouse down
  • keep the existing host, lock, and touch-device guards

why

The overlay prevents the browser's default mouse-down behavior. If focus moves elsewhere while the pointer remains over the video, mouseenter does not fire again and clicking the video cannot restore focus. Subsequent keyboard events are delivered to the previously focused control instead of the remote browser.

validation

  • ran a same-session full-stack A/B three times with trusted mouse and keyboard input
    • stock: focus remained on the external control and the remote field stayed empty
    • patched: focus returned to textarea.overlay and the remote field received abc
  • verified remote mousedown, mouseup, and click delivery still works
  • verified Shift, printable keys, Backspace, and Enter produced the exact remote value Abc1\n
  • bun run lint (0 errors; existing warnings)
  • bun run build (passes; existing lint and bundle-size warnings)

The client does not currently have an automated component test suite for this interaction.


Note

Low Risk
Single guarded focus call in the existing mouse-down path; no auth, data, or protocol changes.

Overview
Fixes a case where keyboard input stopped reaching the remote browser after focus moved to another control on the page while the pointer stayed over the live view.

On desktop mouse down (when hosting and not locked), the client now calls focus() on the overlay textarea so Guacamole keyboard capture is restored without relying on another mouseenter. Existing guards are unchanged: non-hosts still get control-attempt, locked sessions still bail out, and touch devices are skipped so mousedown does not pop the mobile keyboard.

Reviewed by Cursor Bugbot for commit a92bdc9. Bugbot is set up for automated code reviews on this repo. Configure here.

@masnwilliams
masnwilliams merged commit 522c9eb into mainAug 18, 2026
11 checks passed
@masnwilliams
masnwilliams deleted the hypeship/focus-live-view-on-click branch August 18, 2026 18:34
Sign up for freeto 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

@masnwilliams@rgarcia