LCL: Don't set Parent for a standalone form. Issue #18710, patch from cobines.

git-svn-id: trunk@51974 -
This commit is contained in:
juha 2016-03-17 10:52:19 +00:00
parent b192fb9760
commit 33013ddac8
2 changed files with 12 additions and 7 deletions

View File

@ -660,6 +660,7 @@ type
write FDefaultMonitor default dmActiveForm;
property Designer: TIDesigner read FDesigner write FDesigner;
property DesignTimeDPI: Integer read FDesignTimeDPI write FDesignTimeDPI;
property EffectiveShowInTaskBar: TShowInTaskBar read GetEffectiveShowInTaskBar;
property FormState: TFormState read FFormState;
property FormStyle: TFormStyle read FFormStyle write SetFormStyle
default fsNormal;

View File

@ -402,15 +402,19 @@ begin
begin
if (Parent = 0) then
begin
if not Application.MainFormOnTaskBar then
Parent := Win32WidgetSet.AppHandle
else
if (AWinControl <> Application.MainForm) then
// Leave Parent at 0 if this is a standalone form.
if (lForm.EffectiveShowInTaskBar <> stAlways) then
begin
if Assigned(Application.MainForm) and Application.MainForm.HandleAllocated then
Parent := Application.MainFormHandle
if not Application.MainFormOnTaskBar then
Parent := Win32WidgetSet.AppHandle
else
Parent := Win32WidgetSet.AppHandle;
if (AWinControl <> Application.MainForm) then
begin
if Assigned(Application.MainForm) and Application.MainForm.HandleAllocated then
Parent := Application.MainFormHandle
else
Parent := Win32WidgetSet.AppHandle;
end;
end;
end;
CalcFormWindowFlags(lForm, Flags, FlagsEx);