这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@mpondo
Copy link
Contributor

@mpondo mpondo commented May 4, 2022

This is a proposed fix for #349.

The ownership of the OverlayWindow was changed in #326. This works great when the overlay window is 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.

This issue is resolved by not setting the Owner of the OverlayWindow. These changes clear the owner only in the case where the OwnedByDockingManagerWindow is set to false for the window. Otherwise, it maintains the existing behavior.

@Dirkster99
Copy link
Owner

Dirkster99 commented Jul 16, 2022

Somehow I am not able to verify this fix - so to be sure I am posting details of my tested workflow, please let me know if I am missing something in the test case below:

  1. I add the property as described in Dragging window appears behind main window #349 in App,xaml of TestApp
    image

and start TestApp
image

  1. I drag one window from the main window
    image
  2. I drag a 2nd Window from the main window and it disappears behind the first that was dragged off before
    image

The problem is that I get the same behavior (on document window disappearing behind the other document window) in your suggested fix branch and the master branch :-(

Please let me know if I should test this differently then I'll be happy to look at this again.
Thank you

@mpondo
Copy link
Contributor Author

mpondo commented Jul 22, 2022

Thank you for taking a look at this!

Actually, I think you may have found a bigger issue. I had thought the issue was limited to using OwnedByDockingManagerWindow=false, which we use in our app. However, following your exact repro steps, I see the same issue on master without setting the value for OwnedByDockingManagerWindow.

To reproduce this fix, try adding the <Setter Property="OwnedByDockingManagerWindow" Value="False" /> to these 2 locations in Generic.xaml:

From what I can see, these are the styles that are getting the applied in the TestApp. I could not see the property being applied to the window when I made the change in the App.xaml.

Also, note that I included the LayoutDocumentFloatingWindowControl, since that is the type of window that you were testing with in your repro steps.

I hope that helps!

@Dirkster99
Copy link
Owner

Giving a complete and detailed test description rather than implying stuff (because something might get loaded or not) is always helpful and so I am able to verify you test case :-) and everyone else should now also be able to do just that.

So, you fixed the behavior for the <Setter Property="OwnedByDockingManagerWindow" Value="False" /> case, since the floating:

  1. tool window or
  2. document window

is now in front of the docking buttons (OverlayWindow), well done :-) Would you be able to find a fix for the <Setter Property="OwnedByDockingManagerWindow" Value="True" /> case, as well? If so, I would wait until I release a new version since a consistent behavior fix is of course the best thing to get this solved :-)

image
image

@Dirkster99 Dirkster99 merged commit 99b7e8d into Dirkster99:master Jul 23, 2022
Wenveo added a commit to Wenveo/AvalonDock that referenced this pull request Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants