From 75ad1a76f64665f718aae7f2d75c9fc8d934c9ae Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 20 May 2020 15:39:46 -0300 Subject: [PATCH] working win32 non-client area hit testing. --- src/Windows/Avalonia.Win32/WindowImpl.WndProc.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Windows/Avalonia.Win32/WindowImpl.WndProc.cs b/src/Windows/Avalonia.Win32/WindowImpl.WndProc.cs index 001fa042c3..6e825de23a 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.WndProc.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.WndProc.cs @@ -138,8 +138,16 @@ namespace Avalonia.Win32 if (((HitTestValues)lRet) == HitTestValues.HTCAPTION) { var position = PointToClient(PointFromLParam(lParam)); - - var visual = (_owner as Window).Renderer.HitTestFirst(position, _owner as Window, null); + + var visual = (_owner as Window).Renderer.HitTestFirst(position, _owner as Window, x => + { + if(x is IInputElement ie && !ie.IsHitTestVisible) + { + return false; + } + + return true; + }); if(visual != null) {