Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a problem with effects not stopping. #13

Merged
merged 3 commits into from
Jan 10, 2022

Commits on Jan 8, 2022

  1. Fix a problem with effects not stopping.

    With a multiple display setup, some effects would not stop when the mouse existed the notch. If a display is oriented above the notched display, the mouse cursor can move out the 'top' of the notch.
    
     Many of our effects stop rendering when the mouse has moved outside the notch or some distance from the notch. This works because the mouse tracking area extends beyond the the bounds of the notch to the sides and below the notch. In these scenarios we generate `mouseMoved()` calls when the cursor leaves the notch, but is still in that tracking area. In this case though, the mouse can exit the notch at the top, which means it leaves the notch and the tracking area in one update of mouse position. This results in no `mousedMoved()` call, but an immediate `mouseExited()` call.
    
    Effects that expect to end their rendering on a `mouseMove()` that happens with `underNotch == false` would then fail to stop. We could make sure that each effect also stops rendering on `mouseExited()`, but that leaves the door open to repeat this problem because it is not enforced.
    
    This fix adds an explicit call to` mouseMoved(at:underNotch:)` before the call to `mouseExited(at:point:)`. This ensures that any code in mouseMoved that switches on under the notch or not still gets a chance to run in the exit case.
    Chris Parrish authored and Chris Parrish committed Jan 8, 2022
    Configuration menu
    Copy the full SHA
    1e0b05d View commit details
    Browse the repository at this point in the history
  2. fix whitespace

    Chris Parrish authored and Chris Parrish committed Jan 8, 2022
    Configuration menu
    Copy the full SHA
    b9e7874 View commit details
    Browse the repository at this point in the history
  3. really fix whitespace

    Chris Parrish authored and Chris Parrish committed Jan 8, 2022
    Configuration menu
    Copy the full SHA
    acc321a View commit details
    Browse the repository at this point in the history