Repository navigation
fix(computer): pick X11 or Wayland backend at runtime on Linux - #1309
Conversation
robotgo's purego build hard-wires its Wayland backend on Linux, so on an X11 session the Computer tool saw a 0x0 display and every action failed. Call robotgo's pure-Go x11 and wayland subpackages directly and choose per session: X11 when DISPLAY is set without WAYLAND_DISPLAY, Wayland otherwise (including XWayland). macOS and Windows are unchanged. Closes #1303
|
@infer Can you review this PR? is it ready for merge? use /ponytail:ponytail /ponytail:ponytail-review /domain-driven-design /clean-architecture /clean-code |
|
Model: Todos
Pull Request✅ Infer Result: SuccessReview: PR #1309 - ready to merge, no blocking findingsVerdict: yes, this is ready for merge once the still-pending What I verifiedThe premise is correct. In robotgo
So Signature compatibility is exact. All 9 functions the controller uses exist in both Builds pass everywhere (verified locally): Build-tag structure is correct. Findings (all non-blocking)
ponytail-review (over-engineering only)No findings. Checked: all 9 struct fields are consumed at real call sites (no dead flexibility); no new dependencies (both subpackages come from the robotgo module already in Lean already. Ship. (net: 0 lines possible) Domain-driven design: 7/10 diagnostic, no violations introducedThe slice is a pure infrastructure adapter, so the relevant rows pass trivially and the one row this PR actively delivers is the strongest: an Anti-Corruption Layer at the external integration - robotgo's per-platform package layout is now behind the Clean architecture: 9-10 for the slice (7/7 diagnostic rows)The Dependency Rule holds: the entire change is in the outermost circle ( Clean code: 8/10Names reveal intent ( Bottom lineCorrect root-cause fix, minimal diff, verified across all three release platforms, no over-engineering, architecture boundaries respected. Merge once the Model: Tokens: 1,073,060 in · 21,584 out · 1,094,644 total (19 requests) Tool calls: 33 total · 100% success rate TracesStatsTriggered by edenreich · Infer Action · OSS |
|
🎉 This PR is included in version 0.208.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Release builds use
-tags purego, which makes robotgo compile only its Wayland backend on Linux (wayland_n.go). On an X11 session, theComputertool therefore reported a 0x0 display and every action failed. The README says both X11 and Wayland are supported, so switching the build tag topurego x11would only have broken Wayland instead.The display controller now calls robotgo's pure-Go
x11andwaylandsubpackages directly and chooses between them once, at startup:DISPLAYis set andWAYLAND_DISPLAYis notmacOS and Windows still use the top-level robotgo package, so they behave as before. No new dependencies; both subpackages come from the robotgo module we already use.
Testing
go build -tags purego ./...for darwin, linux and windowsTestUseX11)golang:1.26container running Xvfb (DISPLAY=:99): the X11 backend was picked, the display reported 1280x800 and a full-screen capture succeededtask precommit:run, plusgolangci-lintwithGOOS=linuxCloses #1303