Skip to content

feat: hints mode - #45

Merged
ploMP4 merged 4 commits into
mainfrom
hints
Jul 7, 2026
Merged

ploMP4 merged 4 commits into
mainfrom
hints

Conversation

@ploMP4

@ploMP4 ploMP4 commented Jun 15, 2026

Copy link
Copy Markdown
Member

No description provided.

@ploMP4
ploMP4 force-pushed the hints branch 3 times, most recently from 503cb28 to e6482ec Compare June 16, 2026 15:00
@tharropoulos

Copy link
Copy Markdown
Member

@ploMP4 please rename the commit based on scope. 🙏

@tharropoulos
tharropoulos force-pushed the hints branch 2 times, most recently from 10e740a to 2ef6e66 Compare July 3, 2026 12:47
Comment thread README.md Outdated

Detection is pluggable behind a `HintDetector` trait, selected by `hint.detector`:

- **`atspi`** (Linux, built in): reads the desktop [AT-SPI](https://docs.rs/atspi) accessibility tree over D-Bus and uses each interactive element's *own* role and bounding box. This is the most accurate source where it works — exact boxes, real semantics (button, link, menu item, table row…), no pixel guesswork, essentially no false positives. Each application's whole tree is fetched in a single bulk call (with all apps queried concurrently), so detection stays fast even on browser pages with thousands of nodes; children that toolkits materialize lazily (GTK tree and list views) are pulled in with batched follow-up calls, and an app that hasn't built its tree yet is nudged into doing so (its first hint launch may be sparse, the next one is complete). Coverage depends on the app: GTK/Qt/Gecko expose rich trees, Electron/Chromium need accessibility enabled, and games/native canvases expose nothing. On Wayland a client can't know its own window's on-screen position, so AT-SPI coordinates come in window-relative; stochos corrects them using the compositor's real window geometry and hints the active window, where a click is going. Geometry comes from a per-compositor provider (`src/hint/compositor/`, one file each — currently **Hyprland** and **Sway** via their IPC sockets; adding a compositor means adding one provider file). On X11 coordinates are already absolute and every visible window is hinted. Caveats: on Wayland compositors without a provider the semantic coordinates may be offset (the CV detector remains position-correct everywhere), and only the primary monitor is handled.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Holy Claude 🤖

@ploMP4
ploMP4 marked this pull request as ready for review July 6, 2026 15:33
@ploMP4
ploMP4 merged commit 08e1f51 into main Jul 7, 2026
1 check passed
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