Skip to content

Corner failsafe only covers the primary monitor #66

Closed

Description

@TMHSDigital

Why it matters

The corner failsafe is the "slam the mouse into a corner" escape hatch, and it is on by default. On multi-monitor desktops it only works in the four corners of the primary monitor (README, Known limitations). Multi-monitor clicking was just added (#40), so users clicking on a secondary monitor are exactly the ones whose instinctive escape gesture does nothing.

Evidence

  • PyAutoGUI's failsafe checks pyautogui.FAILSAFE_POINTS, derived from pyautogui.size() (primary monitor only).
  • autoclicker/core/safety.py apply_failsafe only toggles pyautogui.FAILSAFE.
  • README: "The corner failsafe watches the corners of the primary monitor only."

Suggested approach

  • Implement the check in the engine: before each click, read GetCursorPos and stop with STOP_SAFETY if the cursor is within a few pixels of a corner of any monitor (enumerate with EnumDisplayMonitors / GetMonitorInfo, refreshed on start alongside _screen_bounds). Keep PyAutoGUI's check as a backstop.
  • Only count corners that are reachable "dead ends" (not shared with an adjacent monitor), so moving between screens never trips it by accident.
  • Reuse _trigger_safety_stop so the status and session log stay consistent.

Done when

  • Moving the cursor into a corner of any monitor stops the run with "Failsafe: mouse moved to a screen corner".
  • Unit tests cover a two-monitor layout including negative coordinates.
  • The Known limitations bullet is removed from the README.

Activity

  1. added
    enhancement
    priority: medium
    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

    enhancementpriority: mediumsafety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions