From 41fbff90eafd352c9500e57ebfcf2240bf8fe0cb Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Mon, 24 Aug 2026 09:17:36 +0000 Subject: [PATCH] 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 --- .../Avalonia.Win32/WindowImpl.AppWndProc.cs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs b/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs index f0140204a4..93d76ee057 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs +++ b/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.