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

PointerMovedEvent and PointerReleasedEvent do not trigger after mouse leaves the title bar with pressed #15696

Open
huangliu opened this issue May 11, 2024 · 1 comment

Comments

@huangliu
Copy link

Describe the bug

I add a contorl to the titlebar, and add Handlers PointerPressedEvent/PointerMovedEvent/PointerReleasedEvent/PointerCaptureLostEvent. When I press/move/release mouse left button over the control, all events trigger as expected.

If I just press mouse and move out the titlebar, PointerMovedEvent will not trigger, unless I release the left button. PointerReleasedEvent does not trigger at this point, and e.GetCurrentPoint(this).Properties.IsLeftButtonPressed still return true in PointerMovedEvent event, until I press left button and release next time.

But If I remove property OSXThickTitleBar from ExtendClientAreaChromeHints, everything works well.

Here is a demo video:

iShot_2024-05-12_01.01.30.mp4

Here is the other demo which works perfect when I just remove OSXThickTitleBar property from ExtendClientAreaChromeHints:

iShot_2024-05-12_01.27.21.mp4

To Reproduce

  1. Set window properties ExtendClientAreaToDecorationsHint="True" / ExtendClientAreaTitleBarHeightHint="38" / ExtendClientAreaChromeHints="Default,OSXThickTitleBar"
  2. Add a control to the top, use the following code to listen for events
this.AddHandler(PointerPressedEvent, this.OnPointerPressed, RoutingStrategies.Tunnel);
this.AddHandler(PointerMovedEvent, this.OnPointerMove, RoutingStrategies.Tunnel);
this.AddHandler(PointerReleasedEvent, this.OnPointerReleased, RoutingStrategies.Tunnel);
this.AddHandler(PointerCaptureLostEvent, this.OnPointerCaptureLost, RoutingStrategies.Tunnel);
  1. Press the control with mouse left button, and move out from titlebar, but don't leave the window.

Expected behavior

No response

Avalonia version

11.0.10

OS

macOS

Additional context

No response

@huangliu huangliu added the bug label May 11, 2024
@huangliu
Copy link
Author

After move out of titlebar with mouse left button hold on, no more PointerMoved event triggered, if OSXThickTitleBar is set.

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

No branches or pull requests

2 participants