You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-11-23 21:34:53 +02:00
Fixed GetScreenDPI in VirtualBox with Linux guest and using Lazarus
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user