这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void IOverlayWindowHost.HideOverlayWindow()

IOverlayWindow IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow)
{
CreateOverlayWindow();
CreateOverlayWindow(draggingWindow);
_overlayWindow.EnableDropTargets();
_overlayWindow.Show();
return _overlayWindow;
Expand Down Expand Up @@ -295,10 +295,20 @@ private void _model_IsVisibleChanged(object sender, EventArgs e)
if (!IsVisible && _model.IsVisible) Show();
}

private void CreateOverlayWindow()
private void CreateOverlayWindow(LayoutFloatingWindowControl draggingWindow)
{
if (_overlayWindow == null) _overlayWindow = new OverlayWindow(this);
_overlayWindow.Owner = Window.GetWindow(this);

// Usually, the overlay window is made a child of the main window. However, if the floating
// window being dragged isn't also a child of the main window (because OwnedByDockingManagerWindow
// is set to false to allow the parent window to be minimized independently of floating windows),
// this causes the floating window to be moved behind the main window. Just not setting the parent
// seems to work acceptably here in that case.
if (draggingWindow?.OwnedByDockingManagerWindow ?? true)
_overlayWindow.Owner = Window.GetWindow(this);
else
_overlayWindow.Owner = null;

var rectWindow = new Rect(this.PointToScreenDPIWithoutFlowDirection(new Point()), this.TransformActualSizeToAncestor());
_overlayWindow.Left = rectWindow.Left;
_overlayWindow.Top = rectWindow.Top;
Expand Down Expand Up @@ -417,4 +427,4 @@ private void OnExecuteCloseWindowCommand(object parameter)

#endregion Private Methods
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,20 @@ bool HitTest(Point dragPoint)

private OverlayWindow _overlayWindow = null;

private void CreateOverlayWindow()
private void CreateOverlayWindow(LayoutFloatingWindowControl draggingWindow)
{
if (_overlayWindow == null) _overlayWindow = new OverlayWindow(this);
_overlayWindow.Owner = Window.GetWindow(this);

// Usually, the overlay window is made a child of the main window. However, if the floating
// window being dragged isn't also a child of the main window (because OwnedByDockingManagerWindow
// is set to false to allow the parent window to be minimized independently of floating windows),
// this causes the floating window to be moved behind the main window. Just not setting the parent
// seems to work acceptably here in that case.
if (draggingWindow?.OwnedByDockingManagerWindow ?? true)
_overlayWindow.Owner = Window.GetWindow(this);
else
_overlayWindow.Owner = null;

var rectWindow = new Rect(this.PointToScreenDPIWithoutFlowDirection(new Point()), this.TransformActualSizeToAncestor());
_overlayWindow.Left = rectWindow.Left;
_overlayWindow.Top = rectWindow.Top;
Expand All @@ -238,7 +248,7 @@ private void CreateOverlayWindow()

IOverlayWindow IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow)
{
CreateOverlayWindow();
CreateOverlayWindow(draggingWindow);
_overlayWindow.EnableDropTargets();
_overlayWindow.Show();
return _overlayWindow;
Expand Down Expand Up @@ -419,4 +429,4 @@ private void OnExecuteCloseWindowCommand(object parameter)

#endregion Private Methods
}
}
}
15 changes: 12 additions & 3 deletions source/Components/AvalonDock/DockingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ bool HitTest(Point dragPoint)
/// <inheritdoc/>
IOverlayWindow IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow)
{
CreateOverlayWindow();
CreateOverlayWindow(draggingWindow);
_overlayWindow.EnableDropTargets();
_overlayWindow.Show();
return _overlayWindow;
Expand Down Expand Up @@ -2095,13 +2095,22 @@ private void SetupAutoHideWindow()
SetAutoHideWindow(new LayoutAutoHideWindowControl());
}

private void CreateOverlayWindow()
private void CreateOverlayWindow(LayoutFloatingWindowControl draggingWindow = null)
{
if (_overlayWindow == null)
{
_overlayWindow = new OverlayWindow(this);
}
_overlayWindow.Owner = Window.GetWindow(this);

// Usually, the overlay window is made a child of the main window. However, if the floating
// window being dragged isn't also a child of the main window (because OwnedByDockingManagerWindow
// is set to false to allow the parent window to be minimized independently of floating windows),
// this causes the floating window to be moved behind the main window. Just not setting the parent
// seems to work acceptably here in that case.
if (draggingWindow?.OwnedByDockingManagerWindow ?? true)
_overlayWindow.Owner = Window.GetWindow(this);
else
_overlayWindow.Owner = null;

var rectWindow = new Rect(this.PointToScreenDPIWithoutFlowDirection(new Point()), this.TransformActualSizeToAncestor());
_overlayWindow.Left = rectWindow.Left;
Expand Down