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

[Bug]: mouseWheelMove called after mouseExit #1343

Open
1 task done
emezeske opened this issue Feb 1, 2024 · 0 comments
Open
1 task done

[Bug]: mouseWheelMove called after mouseExit #1343

emezeske opened this issue Feb 1, 2024 · 0 comments

Comments

@emezeske
Copy link

emezeske commented Feb 1, 2024

Detailed steps on how to reproduce the bug

With the code below, when I rapidly scroll the mouse wheel and move the mouse into and out of the component's area, I am able to occasionally observe unexpected sequences like this:

enter
exit
move (isMouseOver=true)

There are two things about this that strike me as buggy:

  1. It seems that there would be an invariant that isMouseOver only returns true between mouse enter and exit events.
  2. It seems like mouseMove events should also only occur between mouse enter and exit events.

Am I wrong about how this should be expected to work? Or is this a bug?

void MyComponent::mouseWheelMove(
    const juce::MouseEvent&,
    const juce::MouseWheelDetails&) {
  std::cout << "move isMouseOver=" << isMouseOver(true) << ")\n";
}

void MyComponent::mouseEnter(const juce::MouseEvent&) { std::cout << "enter\n"; }

void MyComponent::mouseExit(const juce::MouseEvent&) { std::cout << "exit\n"; }

What is the expected behaviour?

mouseMove events should only occur between mouseEnter and mouseExit events, and isMouseOver(true) should always return true during a mouseMove event.

(This is all provided that the component isn't subscribed to events for another component, etc. This happens with a very simple example with no bells and whistles. To reproduce, I am not touching any mouse buttons or anything, as I know that dragging has special isMouseOver / exit behavior for good reason.)

Operating systems

Windows

What versions of the operating systems?

11, recent patches

Architectures

x86_64

Stacktrace

No response

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • I agree to follow the Code of Conduct
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

No branches or pull requests

1 participant