Skip to content

Raise pointer events on captured element #18420

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

Merged

Conversation

MrJul
Copy link
Member

@MrJul MrJul commented Mar 11, 2025

What does the pull request do?

Alternative to #15357 - please read that PR for a better understanding of the underlying issue.

As noticed in #15357 (comment), completely ignoring the capture leads to some unexpected behavior, such as any control reacting to the mouse moving over, even if they aren't really clickable.

This PR changes the logic to better match UWP: pointer events are now raised for the captured element.
Note that contrary to UWP and Win32, PointerMoved is still only raised when the pointer is directly over the captured element.
We should consider changing that in another PR if needed.

An existing unit test has been updated.

Fixed issues

@MrJul MrJul added the bug label Mar 11, 2025
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0055457-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@jmacato jmacato added this pull request to the merge queue Mar 12, 2025
Merged via the queue into AvaloniaUI:master with commit 3c7c469 Mar 12, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IsPointerOver does not Work with OnPointerReleased
4 participants