1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-09-30 21:28:55 +02:00

Fixed GetScreenDPI in VirtualBox with Linux guest and using Lazarus

This commit is contained in:
Salvador Díaz Fau
2025-08-25 17:24:21 +02:00
parent 8871908c94
commit 6fc5983d2f
2 changed files with 8 additions and 4 deletions

View File

@@ -3129,6 +3129,8 @@ begin
{$IFDEF LINUX}
{$IFDEF FPC}
Result := 0;
if (Application <> nil) and
(Application.MainForm <> nil) and
(Application.MainForm.Monitor <> nil) then
@@ -3140,9 +3142,11 @@ begin
Result := screen.PrimaryMonitor.PixelsPerInch
else
Result := screen.PixelsPerInch;
end
else
Result := USER_DEFAULT_SCREEN_DPI;
end;
// Workaround for a VirtualBox issue.
if (Result = 0) then
Result := USER_DEFAULT_SCREEN_DPI;
{$ELSE}
Result := -1;
if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, TempService) then

View File

@@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 768,
"InternalVersion" : 769,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "139.0.28"
}