From 9054d3a93be9a189d9e3a82e02e69842923c617e Mon Sep 17 00:00:00 2001 From: Noisrev Date: Sat, 24 Dec 2022 21:30:13 +0800 Subject: [PATCH 1/3] Fixed an issue where the dragged window still appeared above the overlay window --- source/Components/AvalonDock/Controls/DragService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Components/AvalonDock/Controls/DragService.cs b/source/Components/AvalonDock/Controls/DragService.cs index 2b5d18e8..e01d5f96 100644 --- a/source/Components/AvalonDock/Controls/DragService.cs +++ b/source/Components/AvalonDock/Controls/DragService.cs @@ -196,6 +196,7 @@ internal void UpdateMouseLocation(Point dragPosition) if (_currentDropTarget != null) { _currentWindow.DragEnter(_currentDropTarget); + BringWindowToTop2((Window)_currentWindow); return; } }); From 2c5c80ce4ab87af1c8bd724c96b83b74506c73ed Mon Sep 17 00:00:00 2001 From: Noisrev Date: Sat, 24 Dec 2022 21:30:13 +0800 Subject: [PATCH 2/3] Fix a issue where the dragged window still appeared above the overlay window --- source/Components/AvalonDock/Controls/DragService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Components/AvalonDock/Controls/DragService.cs b/source/Components/AvalonDock/Controls/DragService.cs index 2b5d18e8..e01d5f96 100644 --- a/source/Components/AvalonDock/Controls/DragService.cs +++ b/source/Components/AvalonDock/Controls/DragService.cs @@ -196,6 +196,7 @@ internal void UpdateMouseLocation(Point dragPosition) if (_currentDropTarget != null) { _currentWindow.DragEnter(_currentDropTarget); + BringWindowToTop2((Window)_currentWindow); return; } }); From 6541b1e35d8a0958b4a7f40d8973d95583e95eee Mon Sep 17 00:00:00 2001 From: Noisrev Date: Sat, 24 Dec 2022 21:33:07 +0800 Subject: [PATCH 3/3] Add null check for BringWindowToTop2 --- source/Components/AvalonDock/Controls/DragService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/Components/AvalonDock/Controls/DragService.cs b/source/Components/AvalonDock/Controls/DragService.cs index e01d5f96..96e6c641 100644 --- a/source/Components/AvalonDock/Controls/DragService.cs +++ b/source/Components/AvalonDock/Controls/DragService.cs @@ -279,6 +279,8 @@ internal void Abort() private void BringWindowToTop2(Window window) { + if (window == null) return; + Win32Helper.SetWindowPos(new WindowInteropHelper(window).Handle, IntPtr.Zero, 0, 0, 0, 0, Win32Helper.SetWindowPosFlags.IgnoreResize | Win32Helper.SetWindowPosFlags.IgnoreMove | Win32Helper.SetWindowPosFlags.DoNotActivate); }