Browse Source

Drop dead WM_POINTERDEVICEINRANGE/WM_POINTERDEVICEOUTOFRANGE handling (#22046)

These notifications are only delivered to windows that opted in via
RegisterPointerDeviceNotifications, which we never call, so both
branches have been unreachable since they were introduced. They also
parse wParam as a pointer id, while these messages carry a device
handle there.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
pull/22054/head
Nikita Tsukanov 2 months ago
committed by GitHub
parent
commit
41fbff90ea
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 17
      src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs

17
src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs

@ -582,7 +582,6 @@ namespace Avalonia.Win32
e = args;
break;
}
case WindowsMessage.WM_POINTERDEVICEOUTOFRANGE:
case WindowsMessage.WM_POINTERLEAVE:
case WindowsMessage.WM_POINTERCAPTURECHANGED:
{
@ -612,22 +611,6 @@ namespace Avalonia.Win32
};
break;
}
case WindowsMessage.WM_POINTERDEVICEINRANGE:
{
if (!_wmPointerEnabled)
{
break;
}
// Do not generate events, but release mouse capture on any other device input.
GetDevicePointerInfo(wParam, out var device, out _, out _, out _, ref timestamp);
if (device != _mouseDevice)
{
_mouseDevice.Capture(null);
return IntPtr.Zero;
}
break;
}
case WindowsMessage.WM_POINTERACTIVATE:
{
//occurs when a pointer activates an inactive window.

Loading…
Cancel
Save