1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-22 22:17:48 +02:00

Added GlobalCEFApp.GTKVersion in Linux

Set GlobalCEFApp.GTKVersion to gtkVersion3 in TinyBrowser and TinyBrowser2 for Lazarus and GTK3 in order to avoid an initial error because the app and Chromium are trying to load diferent versions of GTK.
This commit is contained in:
Salvador Díaz Fau
2025-04-25 16:51:53 +02:00
parent 232e06c8c7
commit 3904180367
5 changed files with 38 additions and 1 deletions

View File

@ -163,6 +163,7 @@ type
FPostQuantumKyber : TCefState;
{$IFDEF LINUX}
FPasswordStorage : TCefPasswordStorage;
FGTKVersion : TCefGTKVersion;
{$ENDIF}
@ -1325,6 +1326,13 @@ type
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:docs/linux/password_storage.md">Chromium document: docs/linux/password_storage.md</see></para>
/// </remarks>
property PasswordStorage : TCefPasswordStorage read FPasswordStorage write FPasswordStorage;
/// <summary>
/// Preferred GTK version loaded by Chromium.
/// </summary>
/// <remarks>
/// <para><see href="https://github.com/chromium/chromium/blob/main/ui/gtk/gtk_compat.cc">See the LoadGtkImpl function in ui/gtk/gtk_compat.cc</see></para>
/// </remarks>
property GTKVersion : TCefGTKVersion read FGTKVersion write FGTKVersion;
{$ENDIF}
/// <summary>
/// Ignores certificate-related errors.
@ -2003,6 +2011,7 @@ begin
FPostQuantumKyber := STATE_DEFAULT;
{$IFDEF LINUX}
FPasswordStorage := psDefault;
FGTKVersion := gtkVersionDefault;
{$ENDIF}
// Fields used during the CEF initialization
@ -3687,6 +3696,11 @@ begin
psKWallet6 : ReplaceSwitch(aKeys, aValues, '--password-store', 'kwallet6');
psBasic : ReplaceSwitch(aKeys, aValues, '--password-store', 'basic');
end;
case FGTKVersion of
gtkVersion3 : ReplaceSwitch(aKeys, aValues, '--gtk-version', '3');
gtkVersion4 : ReplaceSwitch(aKeys, aValues, '--gtk-version', '4');
end;
{$ENDIF}
// The list of features you can enable is here :