Popuped auto hide window is remained when minimize main window of application.

Docking/MDI for WPF Forum

Posted 6 months ago by Yuki
Version: 24.1.2
Platform: .NET 6.0
Environment: Windows 11 (64-bit)
Avatar

Hello,

Popuped auto hide window is remained when minimize main window of application.

We are using nested DockSite, and using WindowsFormsHost in document window.

Would you please check it?

I will send sample project.

Best regards,

Comments (3)

Posted 6 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

This is a tricky situation since it appears:

  • You are using nested dock sites.
  • You have turned off DockSite.UseHostedPopups, which enables workarounds we have to implement for airspace issues with interop (e.g., WinForms) controls.  Part of the workarounds is using a separate WPF Window to host the auto-hide content to avoid z-order issues.
  • You drag a document out of the main dock site and into its own floating host window.  This floating host WPF Window ends up being "owned" (Owner property) by the WPF Window that hosts the main dock site.
  • When you minimize the main WPF Window, Windows seems to minimize the owned floating host WPF Window as well, however WPF doesn't raise any LocationChanged, SizeChanged, or StateChanged events.  Therefore we don't appear to have a way to be notified of that scenario, and therefore don't know to close the auto-hide popup window.

If there weren't floating nested dock sites or the UserHostedPopups=false setting in play here, the issue wouldn't appear.  The only workaround I've found so far is to add this code in your MainWindow constructor:

this.StateChanged += (sender, e) => {
    if (this.WindowState == WindowState.Minimized) {
        foreach (var documentWindow in MainDockSite.Documents) {
            if (documentWindow.Content is DockSite nestedDockSite) {
                nestedDockSite.PrimaryDockHost.CloseAutoHidePopup(true, true);
            }
        }
    }
};

That code will watch for the main window to become minimized and will look for nested dock sites and tell them all to close any open auto-hide popups.


Actipro Software Support

Posted 6 months ago by Yuki
Avatar

Thank you for your reply.

Is it possible to re-open closed popup when the window is restored?

Posted 6 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

You would have to track the auto-hide window that was previously open via nestedDockSite.PrimaryDockHost.AutoHidePopupToolWindow.  Then when the main window unminimizes, if you had tracked that an auto-hide tool window was closed when the main window minimized, you could try to activate it.

Normally this all happens automatically but it's the combination of nested dock sites and interop support that requires you to do it manually.


Actipro Software Support

The latest build of this product (v24.1.4) was released 27 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.