From 849c32718bfcfb7c10223f310f2488a6a6205948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvador=20D=C3=ADaz=20Fau?= Date: Thu, 30 May 2024 12:49:57 +0200 Subject: [PATCH] Fixed Lazarus_Linux_GTK2\PopupBrowser2 demo crash --- demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.pas | 12 +++++++++--- update_CEF4Delphi.json | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.pas b/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.pas index f2caa1e8..c9e55cee 100644 --- a/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.pas +++ b/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.pas @@ -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.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; diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index e7d20c96..933ac751 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,7 +2,7 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 601, + "InternalVersion" : 602, "Name" : "cef4delphi_lazarus.lpk", "Version" : "125.0.19" }