Repository navigation
Commit ccf62e9
authored
fix(computer-use): share This PC with the person on Windows (#6598)
* fix(computer-use): share This PC with the person on Windows
On Windows the agent kept the front and the pointer after it acted. When
the person was using another app, Windows' foreground lock refused the
helper and the step failed with "Ask the person to bring the window to
the front". A mouse movement between the agent placing the pointer and
clicking could move the click.
The helper now takes the front only for the agent's moment. It joins the
foreground app's input queue for one SetForegroundWindow call, the usual
way past the lock. It defers at most half a second to a gap in typing or
a released button. 0.4 s after the last focus or input it gives the
front back to the window that had it, and the pointer to where the
person left it, unless they clicked, typed or moved the mouse since.
Low-level mouse and keyboard hooks tell the person's input from the
agent's injected events and keep only timestamps. A click or key press
of the person's during the moment stops the step with
person_interrupted. Before a button or wheel acts, the pointer goes back
to the exact point if the person moved it. Between steps, a window that
came to the front is put back behind the target at most twice per
request. focus_refused now asks the agent to observe again instead of
asking the person.
Signed-off-by: Jalil <reachjalil@gmail.com>
* fix(computer-use): stop on Windows when the person types while the window comes forward
The interruption baseline was set after the agent's window reached the
front, so a key the person pressed while it came forward could land in
it unnoticed. The baseline is now taken just before the raise. A click
or key since then stops focus with person_interrupted before any input
follows, and the front stays with the agent's window.
Signed-off-by: Jalil <reachjalil@gmail.com>
* fix(computer-use): never raise over a person who typed since the Windows step began
Between steps, Rejoin waited for a gap in the person's typing and then
raised the target, though typing during that wait already stopped the
step. The step now stops before the raise, so the front stays with the
person.
Signed-off-by: Jalil <reachjalil@gmail.com>
* fix(computer-use): never bring a Windows target forward under a held mouse button
TakeGap gave up after half a second, so a drag the person began in
another app and still held could end as a drop into the agent's window.
Taking the front now stops with person_interrupted while any physical
mouse button is down, however long it is held.
Signed-off-by: Jalil <reachjalil@gmail.com>
---------
Signed-off-by: Jalil <reachjalil@gmail.com>1 parent 62fe665 commit ccf62e9
3 files changed
Lines changed: 281 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
156 | 170 | | |
157 | 171 | | |
158 | 172 | | |
| |||
161 | 175 | | |
162 | 176 | | |
163 | 177 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 178 | + | |
| 179 | + | |
167 | 180 | | |
168 | 181 | | |
169 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
0 commit comments