1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-01-13 10:22:04 +02:00

Fixed context menu position in Firemonkey OSR demos running in high DPI monitors

Fixed touch and pen handling function in Firemonkey OSR demos running in high DPI monitors.
Fixed issue #431: Outdated DCPCrypt project link
This commit is contained in:
salvadordf 2022-07-28 11:07:26 +02:00
parent 394186de88
commit 9a1a3bb325
8 changed files with 120 additions and 84 deletions

View File

@ -42,7 +42,7 @@ Delphinus-Support
* [DCEF3](https://github.com/hgourvest/dcef3) * [DCEF3](https://github.com/hgourvest/dcef3)
* [fpCEF3](https://github.com/dliw/fpCEF3) * [fpCEF3](https://github.com/dliw/fpCEF3)
* [CEF](https://bitbucket.org/chromiumembedded/cef/) * [CEF](https://bitbucket.org/chromiumembedded/cef/)
* [DCPcrypt](http://www.cityinthesky.co.uk/opensource/dcpcrypt/) * [DCPcrypt](https://sourceforge.net/projects/lazarus-ccr/files/DCPcrypt/)
* [Chromium](https://chromium.googlesource.com/chromium/src/) * [Chromium](https://chromium.googlesource.com/chromium/src/)
## Attribution ## Attribution

View File

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{BE24D13B-2634-4064-8746-AB331419C5FA}</ProjectGuid> <ProjectGuid>{BE24D13B-2634-4064-8746-AB331419C5FA}</ProjectGuid>
<ProjectVersion>19.3</ProjectVersion> <ProjectVersion>19.4</ProjectVersion>
<FrameworkType>FMX</FrameworkType> <FrameworkType>FMX</FrameworkType>
<MainSource>FMXExternalPumpBrowser.dpr</MainSource> <MainSource>FMXExternalPumpBrowser.dpr</MainSource>
<Base>True</Base> <Base>True</Base>
@ -219,7 +219,7 @@
<DCC_RemoteDebug>false</DCC_RemoteDebug> <DCC_RemoteDebug>false</DCC_RemoteDebug>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes> <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode> <AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''"> <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
@ -276,9 +276,8 @@
</Excluded_Packages> </Excluded_Packages>
</Delphi.Personality> </Delphi.Personality>
<Deployment Version="3"> <Deployment Version="3">
<DeployFile LocalName="..\..\bin\FMXExternalPumpBrowser.exe" Configuration="Debug" Class="ProjectOutput"> <DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="Win32"> <Platform Name="iOSSimulator">
<RemoteName>FMXExternalPumpBrowser.exe</RemoteName>
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
@ -292,11 +291,6 @@
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgsqlite3.dylib" Class="DependencyModule"> <DeployFile LocalName="$(BDS)\Redist\osx32\libcgsqlite3.dylib" Class="DependencyModule">
<Platform Name="OSX32"> <Platform Name="OSX32">
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
@ -312,6 +306,12 @@
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployFile LocalName="..\..\bin\FMXExternalPumpBrowser.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>FMXExternalPumpBrowser.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator"> <Platform Name="iOSSimulator">
<Operation>1</Operation> <Operation>1</Operation>
@ -1437,17 +1437,17 @@
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
</DeployClass> </DeployClass>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
</Deployment> </Deployment>
<Platforms> <Platforms>
<Platform value="Android">False</Platform> <Platform value="Android">False</Platform>

View File

@ -591,11 +591,11 @@ var
TempScale : single; TempScale : single;
begin begin
TempScale := Panel1.ScreenScale; TempScale := Panel1.ScreenScale;
TempViewPt.x := LogicalToDevice(viewX, TempScale); TempViewPt.x := viewX;
TempViewPt.y := LogicalToDevice(viewY, TempScale); TempViewPt.y := viewY;
TempScreenPt := Panel1.ClientToScreen(TempViewPt); TempScreenPt := Panel1.ClientToScreen(TempViewPt);
screenX := TempScreenPt.x; screenX := LogicalToDevice(TempScreenPt.x, TempScale);
screenY := TempScreenPt.y; screenY := LogicalToDevice(TempScreenPt.y, TempScale);
Result := True; Result := True;
end; end;
@ -811,25 +811,23 @@ end;
procedure TFMXExternalPumpBrowserFrm.DoResize; procedure TFMXExternalPumpBrowserFrm.DoResize;
begin begin
try if (FResizeCS <> nil) then
if (FResizeCS <> nil) then try
begin FResizeCS.Acquire;
FResizeCS.Acquire;
if FResizing then if FResizing then
FPendingResize := True FPendingResize := True
else
if Panel1.BufferIsResized then
chrmosr.Invalidate(PET_VIEW)
else else
if Panel1.BufferIsResized then begin
chrmosr.Invalidate(PET_VIEW) FResizing := True;
else chrmosr.WasResized;
begin end;
FResizing := True; finally
chrmosr.WasResized; FResizeCS.Release;
end; end;
end;
finally
if (FResizeCS <> nil) then FResizeCS.Release;
end;
end; end;
procedure TFMXExternalPumpBrowserFrm.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); procedure TFMXExternalPumpBrowserFrm.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
@ -1064,6 +1062,7 @@ var
TempPenInfo : POINTER_PEN_INFO; TempPenInfo : POINTER_PEN_INFO;
TempTouchEvent : TCefTouchEvent; TempTouchEvent : TCefTouchEvent;
TempPoint : TPoint; TempPoint : TPoint;
TempScale : single;
begin begin
Result := False; Result := False;
if not(GetPointerPenInfo(aID, @TempPenInfo)) then exit; if not(GetPointerPenInfo(aID, @TempPenInfo)) then exit;
@ -1110,8 +1109,11 @@ begin
if ((TempPenInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then if ((TempPenInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then
TempTouchEvent.type_ := CEF_TET_CANCELLED; TempTouchEvent.type_ := CEF_TET_CANCELLED;
TempPoint := Panel1.ScreenToClient(TempPenInfo.pointerInfo.ptPixelLocation); TempScale := Panel1.ScreenScale;
// TFMXBufferPanel.ScreenToClient applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent. TempPoint.x := DeviceToLogical(TempPenInfo.pointerInfo.ptPixelLocation.x, TempScale);
TempPoint.y := DeviceToLogical(TempPenInfo.pointerInfo.ptPixelLocation.y, TempScale);
TempPoint := Panel1.ScreenToClient(TempPoint);
TempTouchEvent.x := TempPoint.x; TempTouchEvent.x := TempPoint.x;
TempTouchEvent.y := TempPoint.y; TempTouchEvent.y := TempPoint.y;
@ -1123,6 +1125,7 @@ var
TempTouchInfo : POINTER_TOUCH_INFO; TempTouchInfo : POINTER_TOUCH_INFO;
TempTouchEvent : TCefTouchEvent; TempTouchEvent : TCefTouchEvent;
TempPoint : TPoint; TempPoint : TPoint;
TempScale : single;
begin begin
Result := False; Result := False;
if not(GetPointerTouchInfo(aID, @TempTouchInfo)) then exit; if not(GetPointerTouchInfo(aID, @TempTouchInfo)) then exit;
@ -1157,8 +1160,12 @@ begin
if ((TempTouchInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then if ((TempTouchInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then
TempTouchEvent.type_ := CEF_TET_CANCELLED; TempTouchEvent.type_ := CEF_TET_CANCELLED;
TempPoint := Panel1.ScreenToClient(TempTouchInfo.pointerInfo.ptPixelLocation); TempScale := Panel1.ScreenScale;
// TFMXBufferPanel.ScreenToClient applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent. TempPoint.x := DeviceToLogical(TempTouchInfo.pointerInfo.ptPixelLocation.x, TempScale);
TempPoint.y := DeviceToLogical(TempTouchInfo.pointerInfo.ptPixelLocation.y, TempScale);
TempPoint := Panel1.ScreenToClient(TempPoint);
//TempPoint := Panel1.ScreenToClient(TempTouchInfo.pointerInfo.ptPixelLocation);
TempTouchEvent.x := TempPoint.x; TempTouchEvent.x := TempPoint.x;
TempTouchEvent.y := TempPoint.y; TempTouchEvent.y := TempPoint.y;

View File

@ -219,7 +219,7 @@
<DCC_RemoteDebug>false</DCC_RemoteDebug> <DCC_RemoteDebug>false</DCC_RemoteDebug>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes> <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode> <AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''"> <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
@ -281,12 +281,12 @@
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libPCRE.dylib" Class="DependencyModule"> <DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator"> <Platform Name="iOSSimulator">
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule"> <DeployFile LocalName="$(BDS)\Redist\iossimulator\libPCRE.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator"> <Platform Name="iOSSimulator">
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>

View File

@ -124,6 +124,7 @@ type
function CancelPreviousClick(const x, y : single; var aCurrentTime : integer) : boolean; function CancelPreviousClick(const x, y : single; var aCurrentTime : integer) : boolean;
procedure DoRedraw; procedure DoRedraw;
procedure DoResize; procedure DoResize;
function RealScreenScale: single;
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
function SendCompMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean; function SendCompMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
function ArePointerEventsSupported : boolean; function ArePointerEventsSupported : boolean;
@ -190,7 +191,7 @@ implementation
{$R *.fmx} {$R *.fmx}
uses uses
System.SysUtils, System.Math, FMX.Platform, FMX.Platform.Win, System.SysUtils, System.Math, FMX.Platform, FMX.Platform.Win, FMX.Helpers.Win,
uCEFMiscFunctions, uCEFApplication, uFMXApplicationService; uCEFMiscFunctions, uCEFApplication, uFMXApplicationService;
procedure GlobalCEFApp_OnScheduleMessagePumpWork(const aDelayMS : int64); procedure GlobalCEFApp_OnScheduleMessagePumpWork(const aDelayMS : int64);
@ -576,15 +577,16 @@ procedure TMainForm.chrmosrGetScreenPoint( Sender : TObject;
var screenY : Integer; var screenY : Integer;
out Result : Boolean); out Result : Boolean);
var var
TempPoint : TPointF; TempScreenPt, TempViewPt : TPointF;
TempScale : single;
begin begin
TempPoint.x := LogicalToDevice(viewX, GlobalCEFApp.DeviceScaleFactor); TempScale := RealScreenScale;
TempPoint.y := LogicalToDevice(viewY, GlobalCEFApp.DeviceScaleFactor); TempViewPt.x := viewX;
// LocalToScreen applies the scale factor. No need to call LogicalToDevice to set TempViewPt. TempViewPt.y := viewY;
TempPoint := Panel1.LocalToScreen(TempPoint); TempScreenPt := Panel1.LocalToScreen(TempViewPt);
screenX := round(TempPoint.x); screenX := LogicalToDevice(round(TempScreenPt.x), TempScale);
screenY := round(TempPoint.y); screenY := LogicalToDevice(round(TempScreenPt.y), TempScale);
Result := True; Result := True;
end; end;
procedure TMainForm.chrmosrGetViewRect( Sender : TObject; procedure TMainForm.chrmosrGetViewRect( Sender : TObject;
@ -681,6 +683,21 @@ begin
chrmosr.WasResized; chrmosr.WasResized;
end; end;
function TMainForm.RealScreenScale: single;
var
TempHandle: TCefWindowHandle;
begin
if assigned(GlobalCEFApp) then
result := GlobalCEFApp.DeviceScaleFactor
else
result := 1;
TempHandle := FmxHandleToHWND(Handle);
if (TempHandle <> 0) then
Result := GetWndScale(TempHandle);
end;
procedure TMainForm.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); procedure TMainForm.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
var var
PositionChanged: Boolean; PositionChanged: Boolean;
@ -934,6 +951,7 @@ var
TempPenInfo : POINTER_PEN_INFO; TempPenInfo : POINTER_PEN_INFO;
TempTouchEvent : TCefTouchEvent; TempTouchEvent : TCefTouchEvent;
TempPointF : TPointF; TempPointF : TPointF;
TempScale : single;
begin begin
Result := False; Result := False;
if not(GetPointerPenInfo(aID, @TempPenInfo)) then exit; if not(GetPointerPenInfo(aID, @TempPenInfo)) then exit;
@ -980,10 +998,11 @@ begin
if ((TempPenInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then if ((TempPenInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then
TempTouchEvent.type_ := CEF_TET_CANCELLED; TempTouchEvent.type_ := CEF_TET_CANCELLED;
TempPointF.x := TempPenInfo.pointerInfo.ptPixelLocation.x; TempScale := RealScreenScale;
TempPointF.y := TempPenInfo.pointerInfo.ptPixelLocation.y; TempPointF.x := DeviceToLogical(TempPenInfo.pointerInfo.ptPixelLocation.x, TempScale);
TempPointF.y := DeviceToLogical(TempPenInfo.pointerInfo.ptPixelLocation.y, TempScale);
TempPointF := Panel1.ScreenToLocal(TempPointF); TempPointF := Panel1.ScreenToLocal(TempPointF);
// ScreenToLocal applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent.
TempTouchEvent.x := round(TempPointF.x); TempTouchEvent.x := round(TempPointF.x);
TempTouchEvent.y := round(TempPointF.y); TempTouchEvent.y := round(TempPointF.y);
@ -995,6 +1014,7 @@ var
TempTouchInfo : POINTER_TOUCH_INFO; TempTouchInfo : POINTER_TOUCH_INFO;
TempTouchEvent : TCefTouchEvent; TempTouchEvent : TCefTouchEvent;
TempPointF : TPointF; TempPointF : TPointF;
TempScale : single;
begin begin
Result := False; Result := False;
if not(GetPointerTouchInfo(aID, @TempTouchInfo)) then exit; if not(GetPointerTouchInfo(aID, @TempTouchInfo)) then exit;
@ -1029,10 +1049,11 @@ begin
if ((TempTouchInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then if ((TempTouchInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then
TempTouchEvent.type_ := CEF_TET_CANCELLED; TempTouchEvent.type_ := CEF_TET_CANCELLED;
TempPointF.x := TempTouchInfo.pointerInfo.ptPixelLocation.x; TempScale := RealScreenScale;
TempPointF.y := TempTouchInfo.pointerInfo.ptPixelLocation.y; TempPointF.x := DeviceToLogical(TempTouchInfo.pointerInfo.ptPixelLocation.x, TempScale);
TempPointF.y := DeviceToLogical(TempTouchInfo.pointerInfo.ptPixelLocation.y, TempScale);
TempPointF := Panel1.ScreenToLocal(TempPointF); TempPointF := Panel1.ScreenToLocal(TempPointF);
// ScreenToLocal applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent.
TempTouchEvent.x := round(TempPointF.x); TempTouchEvent.x := round(TempPointF.x);
TempTouchEvent.y := round(TempPointF.y); TempTouchEvent.y := round(TempPointF.y);

View File

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{7AA2E07C-ACFB-4174-A9F1-083E9BB483BC}</ProjectGuid> <ProjectGuid>{7AA2E07C-ACFB-4174-A9F1-083E9BB483BC}</ProjectGuid>
<ProjectVersion>19.3</ProjectVersion> <ProjectVersion>19.4</ProjectVersion>
<FrameworkType>FMX</FrameworkType> <FrameworkType>FMX</FrameworkType>
<MainSource>FMXTabbedOSRBrowser.dpr</MainSource> <MainSource>FMXTabbedOSRBrowser.dpr</MainSource>
<Base>True</Base> <Base>True</Base>
@ -281,14 +281,13 @@
</Excluded_Packages> </Excluded_Packages>
</Delphi.Personality> </Delphi.Personality>
<Deployment Version="3"> <Deployment Version="3">
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule"> <DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator"> <Platform Name="iOSSimulator">
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployFile LocalName="..\..\..\bin\FMXTabbedOSRBrowser.exe" Configuration="Debug" Class="ProjectOutput"> <DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule">
<Platform Name="Win32"> <Platform Name="iOSSimulator">
<RemoteName>FMXTabbedOSRBrowser.exe</RemoteName>
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
@ -297,8 +296,9 @@
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule"> <DeployFile LocalName="..\..\..\bin\FMXTabbedOSRBrowser.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="iOSSimulator"> <Platform Name="Win32">
<RemoteName>FMXTabbedOSRBrowser.exe</RemoteName>
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
@ -1383,17 +1383,17 @@
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
</DeployClass> </DeployClass>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
</Deployment> </Deployment>
<Platforms> <Platforms>
<Platform value="Android">False</Platform> <Platform value="Android">False</Platform>

View File

@ -496,11 +496,11 @@ var
TempScale : single; TempScale : single;
begin begin
TempScale := FMXBufferPanel1.ScreenScale; TempScale := FMXBufferPanel1.ScreenScale;
TempViewPt.x := LogicalToDevice(viewX, TempScale); TempViewPt.x := viewX;
TempViewPt.y := LogicalToDevice(viewY, TempScale); TempViewPt.y := viewY;
TempScreenPt := FMXBufferPanel1.ClientToScreen(TempViewPt); TempScreenPt := FMXBufferPanel1.ClientToScreen(TempViewPt);
screenX := TempScreenPt.x; screenX := LogicalToDevice(TempScreenPt.x, TempScale);
screenY := TempScreenPt.y; screenY := LogicalToDevice(TempScreenPt.y, TempScale);
Result := True; Result := True;
end; end;
@ -903,6 +903,7 @@ var
TempPenInfo : POINTER_PEN_INFO; TempPenInfo : POINTER_PEN_INFO;
TempTouchEvent : TCefTouchEvent; TempTouchEvent : TCefTouchEvent;
TempPoint : TPoint; TempPoint : TPoint;
TempScale : single;
begin begin
Result := False; Result := False;
@ -950,8 +951,11 @@ begin
if ((TempPenInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then if ((TempPenInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then
TempTouchEvent.type_ := CEF_TET_CANCELLED; TempTouchEvent.type_ := CEF_TET_CANCELLED;
TempPoint := FMXBufferPanel1.ScreenToClient(TempPenInfo.pointerInfo.ptPixelLocation); TempScale := FMXBufferPanel1.ScreenScale;
// TFMXBufferPanel.ScreenToClient applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent. TempPoint.x := DeviceToLogical(TempPenInfo.pointerInfo.ptPixelLocation.x, TempScale);
TempPoint.y := DeviceToLogical(TempPenInfo.pointerInfo.ptPixelLocation.y, TempScale);
TempPoint := FMXBufferPanel1.ScreenToClient(TempPoint);
TempTouchEvent.x := TempPoint.x; TempTouchEvent.x := TempPoint.x;
TempTouchEvent.y := TempPoint.y; TempTouchEvent.y := TempPoint.y;
@ -963,6 +967,7 @@ var
TempTouchInfo : POINTER_TOUCH_INFO; TempTouchInfo : POINTER_TOUCH_INFO;
TempTouchEvent : TCefTouchEvent; TempTouchEvent : TCefTouchEvent;
TempPoint : TPoint; TempPoint : TPoint;
TempScale : single;
begin begin
Result := False; Result := False;
@ -998,8 +1003,11 @@ begin
if ((TempTouchInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then if ((TempTouchInfo.pointerInfo.pointerFlags and POINTER_FLAG_CANCELED) <> 0) then
TempTouchEvent.type_ := CEF_TET_CANCELLED; TempTouchEvent.type_ := CEF_TET_CANCELLED;
TempPoint := FMXBufferPanel1.ScreenToClient(TempTouchInfo.pointerInfo.ptPixelLocation); TempScale := FMXBufferPanel1.ScreenScale;
// TFMXBufferPanel.ScreenToClient applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent. TempPoint.x := DeviceToLogical(TempTouchInfo.pointerInfo.ptPixelLocation.x, TempScale);
TempPoint.y := DeviceToLogical(TempTouchInfo.pointerInfo.ptPixelLocation.y, TempScale);
TempPoint := FMXBufferPanel1.ScreenToClient(TempPoint);
TempTouchEvent.x := TempPoint.x; TempTouchEvent.x := TempPoint.x;
TempTouchEvent.y := TempPoint.y; TempTouchEvent.y := TempPoint.y;

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [ "UpdateLazPackages" : [
{ {
"ForceNotify" : true, "ForceNotify" : true,
"InternalVersion" : 418, "InternalVersion" : 419,
"Name" : "cef4delphi_lazarus.lpk", "Name" : "cef4delphi_lazarus.lpk",
"Version" : "103.0.12.0" "Version" : "103.0.12.0"
} }