A user-reported defect on macos-26: hovering a dock icon renders the tooltip as a flat untextured polygon with no icon highlight, and the dock's own background comes out mottled rather than blurred. The only evidence was a screenshot taken by hand, and there was no way to ask for the effect again — so there was nothing to compare against another rail and nothing a fix could be measured by. `AGENTS.md` asks for a log- or test-level proxy for a bug class before a visual fix lands, and this is that proxy for this one. Component: `scripts/dock-hover-probe`, x86 pathway harness. No crate code. Two things a screenshot cannot do. It asks for the hover reproducibly: a hover is an *arrival followed by rest*, not a coordinate, so `hover.c` glides the pointer in over ~200 ms and then genuinely stops posting. Setting the cursor once measures nothing because the window server's tooltip timer never starts, and re-posting the same coordinate every frame restarts that timer forever so the tooltip never appears — both failure modes produce a plausible-looking screenshot of no effect at all. And it brackets each hover with the device's own fail log, so the lines emitted while that effect was composited are separated from the whole boot's noise, filtered to the fail channel (`grep -v '^OFF '`, since an `OFF` record carries `reason=` too and ranking without it inverts the queue). The dock's geometry is not queryable without assistive access, which five of six rails lack, so the probe hovers a band of slots across the bottom centre where a default dock sits and reports the coordinates it used. A rail whose dock is hidden or repositioned yields shots with no dock in them — visibly a miss rather than a silent one. It does not judge the picture; comparing the shots against a known-good rail is the reading. `hover.c` is C for the reason `drag.c` is: the guest's `/usr/bin/python3` has no PyObjC so `import Quartz` fails, while clang and the ApplicationServices headers are present. It is compiled on the guest by the harness; no binary is shipped or committed. Every guest-side call is `timeout`-bounded host-side, and `--rest` is refused rather than clamped below 2.2 s because the shot lands two seconds into the rest and a shorter one would photograph a pointer that had already left. Not verified: this has not yet been run against a live guest. It is committed before that run because it is complete and reviewable, and the run that exercises it is the same macos-26 boot that will harvest the crash reports for the process crashes suspected behind the same defect. Its first run may still need the slot band or the 44 px icon-row offset adjusted per rail. Co-Authored-By: Claude <noreply@anthropic.com>
83 lines
2.9 KiB
C
83 lines
2.9 KiB
C
/*
|
|
* hover.c — glide the pointer onto a point and rest it there, so the guest
|
|
* raises a real hover effect.
|
|
*
|
|
* A dock hover is not a mouse position, it is an *arrival followed by rest*.
|
|
* The window server starts its tooltip timer when the pointer stops moving over
|
|
* a target, so setting the cursor once and returning measures nothing: the
|
|
* effect this probe exists to photograph has not been asked for yet. Equally, a
|
|
* program that keeps re-posting the same coordinate every frame restarts that
|
|
* timer forever and the tooltip never appears. So this glides in over a short
|
|
* approach and then genuinely stops posting.
|
|
*
|
|
* C rather than Python for `drag.c`'s reason: the guest's /usr/bin/python3 has
|
|
* no PyObjC, so `import Quartz` fails, while clang and the ApplicationServices
|
|
* headers are present. Compiled on the guest by the harness; nothing is shipped
|
|
* or committed as a binary.
|
|
*
|
|
* Prints one line of JSON, so a run that posted nothing cannot be mistaken for a
|
|
* run whose hover simply had no effect.
|
|
*
|
|
* Build:
|
|
* clang -O2 -o hover hover.c -framework ApplicationServices -lm
|
|
*/
|
|
#include <ApplicationServices/ApplicationServices.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <time.h>
|
|
#include <unistd.h>
|
|
|
|
static void move_to(double x, double y)
|
|
{
|
|
CGEventRef e = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved,
|
|
CGPointMake(x, y),
|
|
kCGMouseButtonLeft);
|
|
if (!e) {
|
|
return;
|
|
}
|
|
CGEventPost(kCGHIDEventTap, e);
|
|
CFRelease(e);
|
|
}
|
|
|
|
static double now_s(void)
|
|
{
|
|
struct timespec ts;
|
|
clock_gettime(CLOCK_MONOTONIC, &ts);
|
|
return (double)ts.tv_sec + (double)ts.tv_nsec * 1e-9;
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
if (argc != 5) {
|
|
fprintf(stderr, "usage: hover X Y APPROACH_FROM_Y REST_SECONDS\n");
|
|
return 2;
|
|
}
|
|
const double x = atof(argv[1]), y = atof(argv[2]);
|
|
const double from_y = atof(argv[3]), rest = atof(argv[4]);
|
|
if (rest <= 0.0) {
|
|
fprintf(stderr, "hover: rest seconds must be positive\n");
|
|
return 2;
|
|
}
|
|
|
|
/* The approach. Twenty steps over ~200 ms is enough for the window server to
|
|
* see a pointer entering the target rather than teleporting into it, which
|
|
* some hover effects require and all of them are entitled to. */
|
|
const int steps = 20;
|
|
const double start = now_s();
|
|
for (int i = 0; i <= steps; i++) {
|
|
const double t = (double)i / (double)steps;
|
|
move_to(x, from_y + (y - from_y) * t);
|
|
usleep(10000);
|
|
}
|
|
|
|
/* The rest. Deliberately no posting: this is the interval in which the
|
|
* tooltip timer runs and the hover highlight is composited, and a re-post
|
|
* here would restart it. */
|
|
usleep((useconds_t)(rest * 1e6));
|
|
|
|
printf("{\"x\":%.1f,\"y\":%.1f,\"approach_steps\":%d,\"rest_s\":%.2f,"
|
|
"\"elapsed\":%.3f}\n",
|
|
x, y, steps, rest, now_s() - start);
|
|
return 0;
|
|
}
|