diff --git a/lazarus/lcl/include/customform.inc b/lazarus/lcl/include/customform.inc index 95041c6..69e3233 100644 --- a/lazarus/lcl/include/customform.inc +++ b/lazarus/lcl/include/customform.inc @@ -1713,11 +1713,7 @@ begin if (Screen.Forms[I].Menu = Value) and (Screen.Forms[I] <> Self) then raise EInvalidOperation.CreateFmt(sDuplicateMenus, [Value.Name]); - if (FMenu <> nil) and not (csDestroying in FMenu.ComponentState) then - begin - FMenu.DestroyHandle; - FMenu.Parent := nil; - end; + if FMenu <> nil then FMenu.Parent := nil; if (csDestroying in ComponentState) or ((Value <> nil) and (csDestroying in Value.ComponentState)) then @@ -2573,7 +2569,8 @@ var begin Result := TBitmap.Create; try - Result.SetSize(ClientWidth, ClientHeight); + Result.Width := ClientWidth; + Result.Height := ClientHeight; LCLIntf.GetWindowRect(Handle, ARect); with GetClientOrigin do PaintTo(Result.Canvas, ARect.Left - X, ARect.Top - Y); @@ -2880,8 +2877,11 @@ begin Application.ModalStarted; try Include(FFormState, fsModal); - if (PopupMode = pmNone) and HandleAllocated then - RecreateWnd(Self); // need to refresh handle for pmNone because ParentWindow changes if (fsModal in FFormState) - see GetRealPopupParent + if PopupMode = pmNone then + begin + RecreateWnd(Self); + HandleNeeded; + end; ActiveWindow := GetActiveWindow; SavedFocusState := SaveFocusState; SavedCursor := Screen.Cursor; @@ -2950,8 +2950,6 @@ begin if LCLIntf.IsWindow(ActiveWindow) then SetActiveWindow(ActiveWindow); Exclude(FFormState, fsModal); - if ((PopupMode = pmNone) and HandleAllocated) and not (csDestroying in ComponentState) then - RecreateWnd(Self); // need to refresh handle for pmNone because ParentWindow changes if (fsModal in FFormState) - see GetRealPopupParent end; finally Application.ModalFinished;