Rafted window disappear in WinForms interop

Docking/MDI for WPF Forum

Posted 7 years ago by Samuele Gantner
Version: 12.1.0561
Platform: Silverlight Controls
Environment: Windows 7 (64-bit)
Avatar

Hi,

we have a relatively big issue with interop. It's super easy to repro:

  1. Create a WinForms project
  2. Add a DockSite (inside a ElementHost)
  3. Add a couple of tabs
  4. Start the app
  5. Raft the tabs
  6. Minimize the main window to the taskbar

Result:

  1. The rafted windows are not minimized
  2. When you click them or drag them they go to coordinates (-32768, y). Their state remains "Normal"
    From the log: Window Home in location (-32768, 132) with size (1207, 821) and state Normal
  3. There is nothing you can do to get them back

Any suggestions? We would be happy with any of the following:

  • The rafted windows are minimized together with the main window
  • Or, they don't fly away (e.g. the Left value doesn't go in overflow)

Please let me know if you need a sample app.

Thanks!
Sam

Comments (3)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Sam,

We don't test the DockSite within a WinForms app since it's made for use in WPF apps.  We do test WinForms content within the DockSite when in a WPF app though (there is a special option you need to enable to support it).

Offhand, the rafting windows are probably not minimized since they don't have an owner window to track.  In a WPF app, we set the owner to the root Window and they do minimize for that.

It's hard to say what's happening there but that doesn't happen in WPF.  So perhaps WinForms interop is passing back some bad mouse coordinates to our dragging code?

If you send a sample over, we can take a look.  But this sort of product may not work very well within a WinForms app since it can spawn new WPF windows, used for rafting containers.


Actipro Software Support

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Sam,

Thanks for the sample.  We debugged it and it appears that in this scenario (where the WinForms Form is minimized) the MouseEventArgs we are given is returning those very negative positions when the document is dropped.  Oddly enough, we found that it works fine as long as the mouse is in the upper-left portion of the screen but then if you move the mouse to the right or below that region, the blue drop indicator disappears and when the mouse button is released, the window goes offscreen as you saw.

Unfortunately we rely on the MouseEventArgs that is passed to us so there's probably nothing we can do.  Your best bet is to minimize those rafting windows when your main Form minimizes.  That will work around it.


Actipro Software Support

Posted 7 years ago by Samuele Gantner
Avatar

Hi,

thanks for the investigation.

As you propose we implemented a workaround that hides rafted windows when the app is minimimized. This effectively solves the problem.

Thanks,
Sam

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.