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

MacOS Won't Raise PointerMoved on Pointer Release #13977

Open
robloo opened this issue Dec 16, 2023 · 3 comments
Open

MacOS Won't Raise PointerMoved on Pointer Release #13977

robloo opened this issue Dec 16, 2023 · 3 comments

Comments

@robloo
Copy link
Contributor

robloo commented Dec 16, 2023

Describe the bug

MacOS doesn't appear to raise a PointerMoved event when the mouse left button is pressed, moved and then finally released. There is no event on press release.

At first this appears correct -- after all the pointer was just released, it hasn't moved. However, there is no other way to determine that pointer is no longer clicked. This is especially important for code relying both pointer move AND pointer click state.

Note that Windows does NOT have this issue and will raise a final PointerMoved event when the mouse left button is released even thoguh it hasn't moved.

To Reproduce

Steps to reproduce the behavior:

  1. Using MacOS
  2. Add a Grid and then PointerMoved event handler
  3. Within the PointerMoved event handler watch PointerPoint.Properties.IsLeftButtonPressed and do something on move -- think custom dragging
  4. Release the pointer left button (WITHOUT MOVING THE POINTER)
  5. The PointerMoved event is never called

Expected behavior

PointerMoved should be invoked one last time if the pointer press is released even if it hasn't actually moved.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • OS: MacOS
  • Avalonia-Version: 11.0.6

Additional context

Add any other context about the problem here.

@robloo robloo added the bug label Dec 16, 2023
@rabbitism
Copy link
Contributor

I have a question. Why do we need to have this feature in Avalonia? I tested in WPF, there is no MouseMove after MouseUp. What is the correct behavior?

@robloo
Copy link
Contributor Author

robloo commented Dec 20, 2023

Yea, this is more of an observation right now. Definitely needs to be checked a bit before any changes.

The code is originally coming from WinUI and works still on Windows so I probably should check and see if UWP/WinUI work this way too.

I think it's just a convenience feature so PointerReleased isn't needed in cases like this.

@timunie
Copy link
Contributor

timunie commented Dec 20, 2023

@robloo not sure here. But at least it should be the same behavior on each platform. Can you check it with a minimal sample in DevTools for Mac and Windows?

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

Successfully merging a pull request may close this issue.

3 participants