Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

Pointer Position Jumps to 0,0 on Fast Movement

Open robloo opened this issue 1 year ago • 5 comments

Describe the bug

This was first noticed with the ColorPicker but I expect is applies to every control.. Pressing and holding on the spectrum then dragging outside the window bounds will cause the pointer position to report 0,0 (relative) before it is usually fixed. This shouldn't happen and causes jumps in the selected color.

To Reproduce Steps to reproduce the behavior:

  1. Go to the ColorPicker page of the ControlCatalog
  2. On the far-right color spectrum Press/Hold/Drag to change color
  3. While continuing to hold the left mouse button, drag the pointer outside the app window
  4. Notice that the reported pointer position to the control is sometimes (0,0) instead of the last position before the pointer exited the app.

Expected behavior

Pointer position should never be reported as 0,0. Instead, either the last pointer position should be used -- or more accurately -- the pointer position clipped to the bounds of the focused control.

Screenshots

https://user-images.githubusercontent.com/17993847/185774278-b5d84be0-772a-4aba-a919-216167c8e82c.mp4

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Version [e.g. 0.10.0-rc1 or 0.9.12]

Additional context Add any other context about the problem here.

robloo avatar Aug 21 '22 03:08 robloo

This actually occurs for fast movement in general. If the mouse is moved quickly over the control it will happen even if the pointer doesn't leave the app window.

I do not think this is an issue with the ColorPicker and think it was working before some of the later PRs for composition or pointer events.

robloo avatar Aug 26 '22 00:08 robloo

@robloo do you think this issue is related to this behavior?

When resizing a column in the TreeDataGrid, or dragging the ScrollBar I get some flicker in some controls and sometimes in the mouse pointer.

It seems that the Control is getting called to PointerExited and PointerEntered very fast.

flicker flicker2

danipen avatar Aug 26 '22 07:08 danipen

@danipen Please, file a separate issue since it seems to be a different bug

kekekeks avatar Aug 26 '22 09:08 kekekeks

@danipen It looks like your issue may be related to #8795. I also noticed some fast blinking in some mouse over situations. You might just want to move your comment there.

robloo avatar Aug 26 '22 09:08 robloo

Not a regression, as this bug existed before 11.0. Unlikely other pointer blinking related issues.

maxkatz6 avatar Sep 13 '22 18:09 maxkatz6