Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

Fix MouseDevice not reporting clicks when any mouse buttons is hold

Open Takoooooo opened this issue 1 year ago • 4 comments

What does the pull request do?

Currently if you will click e.g button with left mouse button and hold it and start clicking the right mouse button then right mouse button wont trigger any PointerPressed\PointerReleased events. That doesen't match a WPF behavior. Also,if you hold any mouse button and click any other mouse button and don't move your mouse Avalonia will send MouseMove events which is quite strange.

What is the current behavior?

Анимация1

What is the updated/expected behavior with this PR?

Анимация1

Breaking changes

That might be a soft breaking change for someone who is relaying on the incorrect behavior.

Fixed issues

Fixes https://github.com/AvaloniaUI/Avalonia/issues/13977

Takoooooo avatar Feb 23 '24 17:02 Takoooooo

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

avaloniaui-bot avatar Feb 23 '24 18:02 avaloniaui-bot

@Takoooooo since it was a bug in MouseDevice, it should be possible to add some tests for this behavior.

maxkatz6 avatar Feb 24 '24 00:02 maxkatz6

@Takoooooo since it was a bug in MouseDevice, it should be possible to add some tests for this behavior.

Sure, will do!

Takoooooo avatar Feb 24 '24 00:02 Takoooooo

This might indirectly close #13977 as well. If you are no longer raising PointerMoved events when the mouse doesn't actually move on Windows (i.e. when button is just released) then that is the intended behavior and will work as in macOS.

I was just using a trick to avoid watching PointerReleased and just watching PointerMoved for releases as well.

Edit: after re-reading the linked issue I do think it should be closed. We are now following WPF behavior on all platforms and PointerMoved isn't being invoked extra times.

robloo avatar Feb 24 '24 17:02 robloo

Extra pressed buttons are supposed to arrive as pointer update events. It's specifically designed to match UWP, not WPF.

kekekeks avatar Feb 26 '24 06:02 kekekeks

https://github.com/AvaloniaUI/Avalonia/issues/2857

kekekeks avatar Feb 26 '24 06:02 kekekeks