Skip to content

Click queuing: Stop (F7) keeps clicking, and later runs never click #38

Closed

Description

@TMHSDigital

Summary

With Advanced → Enable click queuing turned on, pressing Stop (F7) does not stop clicking, and every run after the first never clicks at all. For an input-automation tool, "Stop doesn't stop" is the most serious class of bug.

Why it matters

  • Stop/F7 returns, the UI shows "Stopped", but the queue processor keeps firing queued clicks for seconds afterwards.
  • After the first stop the processor thread is gone but enable_queuing stays True, so the next Start silently enqueues into a queue nobody drains — zero clicks, then dropped_click_count climbs.
  • The queue path bypasses the safety design: a SafetyError from the failsafe corner inside the processor is caught and logged (click_engine.py:284), so on_safety_stop never fires; pause-when-unfocused only gates enqueueing, not execution.

Evidence

  • autoclicker/core/click_engine.py:237-253 — _stop_queue_processor() (non-emergency path) appends a sentinel behind pending work, join(timeout=1.0), then sets queue_processor_thread = None whether or not the thread actually exited.
  • stop_clicking() (:287) calls _stop_queue_processor() without drop_pending=True.
  • Nothing restarts the processor on the next start_clicking(); the GUI checkbox (gui/sections/advanced.py:71, main_window.py:377) still shows queuing enabled.

Reproduced with mocked pyautogui (interval 0, queuing on):

clicks at stop 188   clicks 1.5s after stop returned 276
queue run1 clicks 19  run2 clicks 0  queued 15  proc None

Suggested approach

The queue adds latency and failure modes without a real benefit for a single-target clicker (the click loop is already a dedicated thread, and docs/PERFORMANCE.md doesn't show a win). Preferred: remove the queue feature (engine code, checkbox, README/ARCHITECTURE references). If it must stay:

  • Every stop path drops pending work, and the processor checks _stop_event before each click.
  • Start (re)launches the processor when enable_queuing is set.
  • Processor routes SafetyError/failsafe to _trigger_safety_stop and honours pause-when-unfocused at execution time.

Done when

  • No clicks are emitted after stop_clicking() / emergency_stop() returns (regression test).
  • Consecutive start/stop cycles behave identically with or without the option (or the option no longer exists).
  • docs/ARCHITECTURE.md stop-path table updated.

Activity

  1. added
    bug
    priority: high
    safety
    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: highsafety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions