Fixed Lazarus_Linux_GTK2\PopupBrowser2 demo crash

This commit is contained in:
Salvador Díaz Fau 2024-05-30 12:49:57 +02:00
parent 013bbe441c
commit 849c32718b
2 changed files with 10 additions and 4 deletions

View File

@ -345,15 +345,21 @@ begin
end;
procedure TMainForm.CreateHiddenChildForm;
var
TempSize : TCefSize;
begin
// Linux requires a fully formed window in order to add a Chromium browser so
// we show the next popup window outside the visible screen space and then we
// hide it.
FChildForm := TChildForm.Create(self);
FChildForm.Top := -1000;
FChildForm.Left := -1000;
TempSize.width := FChildForm.Width;
TempSize.height := FChildForm.Height;
FChildForm.Width := 0;
FChildForm.Height := 0;
FChildForm.Show;
FChildForm.Hide;
FChildForm.Width := TempSize.width;
FChildForm.Height := TempSize.height;
// Center the child form on the screen by default
FChildForm.Top := (screen.Height - FChildForm.Height) div 2;
FChildForm.Left := (screen.Width - FChildForm.Width) div 2;

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 601,
"InternalVersion" : 602,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "125.0.19"
}