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

Ignore mouse move when left window #13724

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

ltetak
Copy link
Contributor

@ltetak ltetak commented Nov 24, 2023

What does the pull request do?

Fix a bug when you resize or move a window and still receive PointerOver mouse events.
It is an Avalonia 11 regression from my previous PR #7804.

What is the current behavior?

Resize and move a window and see that seemingly random controls receive PointerOver events. This triggers mouse over style changes but also tooltips appearing, etc.

What is the updated/expected behavior with this PR?

no PointerOver events

cc: @maxkatz6 This may interest you, thanks.

Comment on lines -44 to +48
if (args.Type is RawPointerEventType.LeaveWindow or RawPointerEventType.NonClientLeftButtonDown
or RawPointerEventType.TouchCancel or RawPointerEventType.TouchEnd
&& _currentPointer is var (lastPointer, lastPosition))
if (args.Type is RawPointerEventType.LeaveWindow or RawPointerEventType.NonClientLeftButtonDown
or RawPointerEventType.TouchCancel or RawPointerEventType.TouchEnd)
{
_currentPointer = null;
ClearPointerOver(lastPointer, args.Root, 0, PointToClient(args.Root, lastPosition),
new PointerPointProperties(args.InputModifiers, args.Type.ToUpdateKind()),
args.InputModifiers.ToKeyModifiers());
if (_currentPointer is var (lastPointer, lastPosition))
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to clear PointerOver (since there is none) - but we also do not want to set any later in this conditions chain.

@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Dec 1, 2023
@maxkatz6 maxkatz6 added this pull request to the merge queue Dec 1, 2023
Merged via the queue into AvaloniaUI:master with commit 4a689cb Dec 1, 2023
6 checks passed
maxkatz6 pushed a commit that referenced this pull request Dec 5, 2023
#Conflicts:
#	src/Avalonia.Base/Input/PointerOverPreProcessor.cs
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants