Skip to content

Pause when unfocused stalls after one click when started from the Start button, with no Paused status #63

Closed

Description

@TMHSDigital

Why it matters

Pause when window loses focus quietly stops doing anything after one click when the run is started with the Start button, which is the most common path for new users. The status bar keeps saying "Running..." and the runtime keeps ticking, so it looks like the app is broken or the target app is ignoring clicks.

Evidence

  • ClickEngine.start_clicking records the foreground window at start (autoclicker/core/click_engine.py:148-152).
  • When Start is clicked, the foreground window is the autoclicker itself. The first click at the target activates the target's window, so the foreground no longer matches and _should_pause_for_foreground (click_engine.py:283-285, 324-327) pauses for the rest of the run.
  • Started from the F6 hotkey it works, because the target window is in front at that moment. Neither the UI nor the README explains the difference (README: "remembers the window in front when you start").
  • There is no Paused state: the loop just waits in 100 ms steps, and main_window.py _update_status_loop keeps showing "Running...". Auto-stop minutes keep counting while paused, which is also undocumented.

Suggested approach

  1. When the remembered HWND belongs to our own process (button start), remember the window under the target point instead (WindowFromPoint + GetAncestor(GA_ROOT) in Fixed mode), or wait for the next foreground window that is not ours.
  2. Surface the state: have the engine expose is_paused (or a callback) and show "Paused: target window not in front" with the alert color, mirrored in the tray tooltip.
  3. Decide whether auto-stop counts paused time and document it.

Done when

  • Start button + Pause when unfocused clicks continuously while the target window stays in front, and pauses when the user switches away.
  • The status bar shows a distinct Paused state and returns to Running when focus comes back.
  • Tests cover: own-window HWND at start, pause and resume transitions, and the status message.

Activity

  1. added
    bug
    priority: medium
    safety
    ux
    on Oct 4, 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: mediumsafetyux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions