Skip to content

feat(linux): Tk focus-free write via send IPC - #1813

Merged
r33drichards merged 2 commits into
claude/lucid-lovelace-CMVuMfrom
worktree-agent-a1c3cfdef7dc988b3
Jun 3, 2026
Merged

feat(linux): Tk focus-free write via send IPC#1813
r33drichards merged 2 commits into
claude/lucid-lovelace-CMVuMfrom
worktree-agent-a1c3cfdef7dc988b3

Conversation

@r33drichards

Copy link
Copy Markdown
Collaborator

Summary

Implements focus-free background writes for Tk (tkinter Entry) via Tk's native send IPC mechanism.

Problem

  • Tk has no AT-SPI bridge at all
  • Reads degrade to X11 window node
  • No accessible editable interface

Solution

  1. Test app registers as cua-tk-target via tk appname
  2. Driver spawns wish and sends Tcl commands:
    send cua-tk-target {.entry insert insert {text}}
  3. Tk's X11 IPC delivers the command to the target app
  4. Entry widget receives text without any focus interaction

Key Insight

Toolkit-specific override (like CDP for Chromium). Proves non-accessible toolkits can support focus-free input with bespoke paths.

Files Changed

  • platform-linux/src/input/mod.rs (+53 lines - inject_tk_send)
  • platform-linux/src/tools/impl_.rs (+7 lines - integration)
  • nix/cua-driver/tests/linux-background-gui.nix (+37 lines - tksend=true, readback assertion)

Testing

nix build .#checks.x86_64-linux.cua-driver-linux-background-gui-tk

Tk has no AT-SPI bridge, so background writes use Tk's `send` IPC instead.
The test app registers as "cua-tk-target" and the driver injects text by
spawning `wish` to send Tcl commands. This is the Tk-specific override
(like CDP for Chromium), proving non-accessible toolkits can support
focus-free input with bespoke paths.

- Add inject_tk_send() in platform-linux/input/mod.rs
- Wire it into type_text tool after AT-SPI, before XSendEvent fallback
- Update Tk test app to register with tk appname + name entry widget
- Add tkSubtest that asserts the write lands and focus stays put
- Include pkgs.tk so wish is available in the test environment

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jun 3, 2026 12:22am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fabc1ec0-03fb-4109-b09a-82a4b47868d7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-agent-a1c3cfdef7dc988b3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Linux visual regression artifacts

Matrix jobs now run independently. Download GIF artifacts from this workflow run:

  • cua-driver-linux-cursor-click-gif
  • cua-driver-linux-background-terminal-gif
  • cua-driver-linux-background-gui-gtk
  • cua-driver-linux-background-gui-gtk4
  • cua-driver-linux-background-gui-qt
  • cua-driver-linux-background-gui-qt6
  • cua-driver-linux-background-gui-chromium
  • cua-driver-linux-background-gui-electron
  • cua-driver-linux-background-gui-tk

Open workflow run and download artifacts

@r33drichards
r33drichards merged commit 2e57527 into claude/lucid-lovelace-CMVuM Jun 3, 2026
16 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants