lcl: TCustomForm.ShowModal: recreate handle only if handle was allocated, don't use HandleNeeded

git-svn-id: trunk@51631 -
This commit is contained in:
ondrej 2016-02-14 16:22:31 +00:00
parent 6ee68dbc01
commit d7e4677c9f

View File

@ -2901,11 +2901,8 @@ begin
Application.ModalStarted;
try
Include(FFormState, fsModal);
if PopupMode = pmNone then
begin
RecreateWnd(Self);
HandleNeeded;
end;
if (PopupMode = pmNone) and HandleAllocated then
RecreateWnd(Self); // need to refresh handle for pmNone because ParentWindow changes if (fsModal in FFormState) - see GetRealPopupParent
ActiveWindow := GetActiveWindow;
SavedFocusState := SaveFocusState;
SavedCursor := Screen.Cursor;