Skip to content

Fix potential crash when all menu bar show modes are disabled#900

Open
a67793581 wants to merge 1 commit intojordanbaird:mainfrom
a67793581:fix/crash-when-all-modes-disabled
Open

Fix potential crash when all menu bar show modes are disabled#900
a67793581 wants to merge 1 commit intojordanbaird:mainfrom
a67793581:fix/crash-when-all-modes-disabled

Conversation

@a67793581
Copy link
Copy Markdown

Description

This PR addresses a potential crash when all menu bar interaction modes ("Show on click", "Show on hover", and "Show on scroll") are disabled.

Changes

  • Added a combined observer in EventManager.swift to monitor the states of all interaction modes, including the "Show context menu on right click" setting.
  • Implemented automatic starting and stopping of all event monitors based on these settings.
  • When all interaction features are disabled, the app will now stop its global event monitors, saving system resources and avoiding unnecessary code path executions that could lead to crashes in certain system states.
  • The monitors are immediately restarted if any of the features are re-enabled by the user.

Verification

The logic ensures that UniversalEventMonitor is only active when there's an actual feature that needs to listen for system-wide mouse or scroll events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant