feat(miri): click or drag a hidden window's edge slice to reach it#81

merged10
miri/v0.5.2
miri/150-slice-input
opened12d agobySSamanyu Das
View on GitHubTwo-way sync enabledPR last imported 12d ago

Summary

With displays side by side, a hidden column on the edge the displays share shows as a photo in a panel (#80), because macOS would move the real window to the other display (samanyudas/miri#150). On stacked displays you can click a hidden window's sliver. This PR makes the panel work the same way, step 5 of #150.

  • A press on a panel focuses its window and scrolls it into view. Once the window server reports the window under the pressed point, the engine posts the press there, at HID level. The pointer moves to that point.
  • The press keeps its row and lands at least 12 points inside the window's edge that faces the slice. A 5-point slice maps to the window's outer 5 points, and on Sam's Mac the outer 3 were the resize border. Presses there reached no view, and a quick double click stretched the window. Sam chose the inset.
  • A drag that starts on the panel continues in the app after the press arrives. A drag that ends before the window arrives reaches no app, so it never turns into a click.
  • A release made before the posted press but seen after it moves with the press, so a quick click arrives as one press and release at one point.
  • While a press waits, other presses are dropped with their drags and releases, until it is delivered or expires after 1.5 s. A fast double click acts as one click, and a click never reaches the window beside the slice.
  • Scroll and hover over a panel do nothing. find_window_at_point skips slice panels, so focus-follows-mouse, clicks, drags, and maximize never act on the window beneath a panel.

Only the event tap writes the gesture state (src/platform/slice_tap.rs). The engine side holds one pending press with a deadline (src/ecs/slice_input.rs).

Stacked on #80.

Evidence

Live on Sam's Mac, 29 October, with the displays side by side, engine c99fbe8, driven with HID events on an AppKit view and a Chromium page:

  • Quick clicks with the release 30, 60, 80, 100, 120, and 150 ms after the press: the app got the press and the release at one point, 12 points inside the edge (column 1188 of 1200). The window arrived 60 to 170 ms after the press.
  • A double click with 30 ms steps reached the app as one click. With 50 ms steps it arrived as a real double click with click count 2.
  • A drag from the panel: the press, 20 moves, and the release 200 points lower.
  • Hover and scroll over the panel changed nothing, and the window beside the slice got nothing.

The later fixes, f0c5d76, fb1bbf4, and e30ba61, guard event reorders that did not happen in those runs. Harness tests cover them. 17 tests in src/tests/slice_input.rs run the real tap. Each later fix's test failed before the fix.

  • make engine-lint passes. Engine cargo test --no-default-features: 1048, 42, and 1 passed, 0 failed.

Reviewed with sol-loop: 5 rounds with gpt-6.1-sol on high. Sol verdict: approved

Started by a GPT-6.1 Sol continuation in T3 Code. Finished with Claude Opus 5.5 in Claude Code.

๐Ÿค– Generated with Claude Code

Checks

1 skipped
All checks passed
b741dfc
Synced from GitHub

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.

External image Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79dafce3-7a20-4bd2-ae98-b344be66ee2b

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
  • Autofix ยท Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Added 10 commits

  • fix(miri): drop a second press while a slice press waits for its window0e0e417
  • feat(miri): hold a press on an edge slice panel back from the window beneath2307b1d
  • fix(miri): drop a second slice press that reaches the tap after delivery2ee9d4c
  • test(miri): presses, drags, scrolls, and hovers on edge slice panels3cb8c34
  • feat(miri): reveal a pressed slice's window and post the press there898df99
  • fix(miri): move a slice release made before its press arrived with ita1bcc94
  • fix(miri): drop a press made before a held slice press expiredb741dfc
  • fix(miri): drop a slice drag released before its window arrivesc34c57c
  • fix(miri): land a slice press 12 points inside the edge its panel showsc373997
  • fix(miri): keep each dropped slice button dropped until its releasedc27f48