Skip to content

Commit

Permalink
GetFloatingWindowsByZOrder also from mainProcess when no other window…
Browse files Browse the repository at this point in the history
…ParentHandle is available
  • Loading branch information
Dirkster99 committed Oct 5, 2019
1 parent b054943 commit aed7a02
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions source/Components/Xceed.Wpf.AvalonDock/DockingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This program is provided to you under the terms of the Microsoft Public
using System.Windows.Data;
using System.Windows.Threading;
using Xceed.Wpf.AvalonDock.Themes;
using System.Diagnostics;

namespace Xceed.Wpf.AvalonDock
{
Expand Down Expand Up @@ -2207,12 +2208,20 @@ internal void StartDraggingFloatingWindowForPane( LayoutAnchorablePane paneModel

internal IEnumerable<LayoutFloatingWindowControl> GetFloatingWindowsByZOrder()
{
IntPtr windowParentHanlde;
var parentWindow = Window.GetWindow( this );
if( parentWindow != null )
{
windowParentHanlde = new WindowInteropHelper( parentWindow ).Handle;
}
else
{
var mainProcess = Process.GetCurrentProcess();
if( mainProcess == null )
yield break;

if( parentWindow == null )
yield break;

IntPtr windowParentHanlde = new WindowInteropHelper( parentWindow ).Handle;
windowParentHanlde = mainProcess.MainWindowHandle;
}

IntPtr currentHandle = Win32Helper.GetWindow( windowParentHanlde, ( uint )Win32Helper.GetWindow_Cmd.GW_HWNDFIRST );
while( currentHandle != IntPtr.Zero )
Expand Down

0 comments on commit aed7a02

Please sign in to comment.