WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

InputNonClientPointerSource.PointerReleased event is not invoked when the pointer is moved away while a button is pressed

Open lhak opened this issue 9 months ago • 0 comments

Describe the bug

To implement custom drawn window buttons, pointer events need to be handled to draw the buttons correctly. The InputNonClientPointerSource.PointerPressed event can be used to detect when a mouse button is pressed in the non client area (e.g. on a window button). However, when the pointer is moved out of the non client area while the button is pressed, the InputNonClientPointerSource.PointerReleased event is not invoked when the button is finally released. It is invoked once the pointer is moved back. This makes implementing the different window button states correctly basically impossible.

Steps to reproduce the bug

  1. Register for InputNonClientPointerSource.PointerReleased event
  2. Press the mouse button while the pointer is in a non client area and then mvoe it out while keeping the button pressed
  3. Release the button -> Observe that the event is not invoked
  4. Move the pointer back to the non client area -> The event is now invoked

Expected behavior

There should be away to track button releases even when the pointer is moved out of the non client area.

Screenshots

No response

NuGet package version

Windows App SDK 1.5.3: 1.5.240428000

Packaging type

Unpackaged

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

No response

Additional context

No response

lhak avatar May 16 '24 20:05 lhak