Skip to content

Sequence plus Pause when unfocused stalls when steps are in different windows #81

Closed

Description

@TMHSDigital

Why it matters

Sequences (#72) are meant for routines like "claim in one window, close a dialog in another". With Pause when window loses focus on, such a run stops doing anything after the first step that lands in a different window. The status says "Paused: waiting for the target window to be in front" forever. From the user's side it looks like sequences don't work with the pause option.

Evidence

  • autoclicker/core/click_engine.py:279-281: in sequence mode the focus window is picked from the first step only:
    if self._steps:
        x, y = self._steps[0].x, self._steps[0].y
    self._foreground_hwnd = self._pick_focus_window(hwnd, x, y)
  • click_engine.py:489: every later check requires that one window to be in front. Clicking a step that sits in another top-level window activates that window, so the run pauses and never resumes.
  • These lines are not covered by any test (coverage report: click_engine.py missing 279-281).

Suggested approach

  • In sequence mode, collect the set of top-level windows under all step points (root_window_at for each step, excluding our own) and treat the run as focused while any of them is in front. If none can be read, keep the current adopt-next-window behaviour.
  • Alternatively, warn at Start when steps span several windows and pause-when-unfocused is on.
  • Add engine tests for a two-window sequence: run continues while either window is in front, pauses when an unrelated window is.

Done when

  • A sequence whose steps are in two different windows runs to completion with Pause when unfocused on, and still pauses when the user switches to a third window.
  • README Sequences section mentions how the pause option behaves with multi-window sequences.

Activity

  1. added
    bug
    priority: high
    safety
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: highsafety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions