Skip to content

fix(scap-targets): keep partially visible X11 windows selectable - #2906

Open
yashranaway wants to merge 2 commits into
CapSoftware:mainfrom
yashranaway:fix/target-select
Open

yashranaway wants to merge 2 commits into
CapSoftware:mainfrom
yashranaway:fix/target-select

Conversation

@yashranaway

@yashranaway yashranaway commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

on linux, a window was matched to whichever display contained its centre point. move a window so its centre is off screen, or sitting in the gap between two monitors, and it dropped out of the window picker even though most of it was still visible.

now a window goes to the display it overlaps the most, and only disappears once none of it is on any display. the xvfb test moves a real window half off screen and checks it's still listed, plus unit tests for monitor gaps and two displays.

note: #2816 adds a second copy of the centre point check in its x11 snapshot parser, so whichever of the two lands second should switch that path to this overlap helper too.

RetriggerView in GreptileConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking gap in CI coverage.

Findings

  1. P2 CI skips the regression test ▶
Fix with agent prompt
### Issue 1
crates/scap-targets/tests/linux_targets.rs:14
The new X11 test is marked `#[ignore]`, but no CI job runs it with `--ignored`. The existing Xvfb job runs only `cap-gpui` tests, so a change that breaks window selection can pass CI without exercising this test.

Add a Linux CI step that runs `xvfb-run -a cargo test --locked -p scap-targets --test linux_targets -- --ignored`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Changes Linux window selection to use the display with the largest visible overlap instead of the display containing the window center.

  • Partly visible Linux X11 windows stay selectable.

Reviews (1) · Last reviewed commit: "fix(scap-targets): keep partially visibl..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@yashranaway is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

@yashranaway

Copy link
Copy Markdown
Contributor Author

@greptileai review

};

#[test]
#[ignore = "requires an isolated X11 server, run with xvfb-run"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 CI skips the regression test

The new X11 test is marked #[ignore], but no CI job runs it with --ignored. The existing Xvfb job runs only cap-gpui tests, so a change that breaks window selection can pass CI without exercising this test.

Add a Linux CI step that runs xvfb-run -a cargo test --locked -p scap-targets --test linux_targets -- --ignored.

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/scap-targets/tests/linux_targets.rs
Line: 14

Comment:
**CI skips the regression test**

The new X11 test is marked `#[ignore]`, but no CI job runs it with `--ignored`. The existing Xvfb job runs only `cap-gpui` tests, so a change that breaks window selection can pass CI without exercising this test.

Add a Linux CI step that runs `xvfb-run -a cargo test --locked -p scap-targets --test linux_targets -- --ignored`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fair, fixed in 09a22a2. the test now starts its own Xvfb, isn't ignored anymore, and runs in the existing linux desktop regression step. checked it fails with the old window selection and passes with the fix.

@richiemcilroy

Copy link
Copy Markdown
Member

Thanks @yashranaway, the fix looks right to us. Greptile's 4/5 is about coverage: the new X11 test in crates/scap-targets/tests/linux_targets.rs is #[ignore] and no CI job runs it with --ignored. Could you add a step to the existing Linux Xvfb job that runs xvfb-run -a cargo test --locked -p scap-targets --test linux_targets -- --ignored, then comment @greptileai review? Thanks!

This branch has not been deployed

No deployments
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