This may be known "feature", and is no doubt a "feature" of the VCL, but I thought someone else may benefit from my investigation.
After adding LMD docking into an existing product (recently upgraded to Delphi XE3), I came across a particularly frustrating issue. If an floating dock panel was over the application's main form, it was impossible to get any dock sites to appear when attempting to dock another floating panel onto it. All was fine if the floating panels were away from the main form.
After a few frustrating hours, I tracked the problem to the fact that TCustomForm.CreateWnd sets the parent handle of a form with no specified parent to the application's handle if Application.MainFormOnTaskBar is false and to the main form if true.
When the VCL is looking for the top-most dock site (in Vcl.Controls.pas), GetDockSiteAtPos uses the TSiteList class to determine which dock site is ontop by checking the z-order of each form's topmost parent. When the floating form's parent is the application's "hidden window" handle, this is UNDERNEATH the main form and therefore ignored in favor of the main form.
Would some sort of assertion/run-time warning be valuable in the LMD code?
Any thoughts?
Comments