You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-09-30 21:28:55 +02:00
Added workaround for focus issues in Linux
Added workaround for the CEF issue #2026 : https://bitbucket.org/chromiumembedded/cef/issues/2026/multiple-major-keyboard-focus-issues-on
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<ProjectSession>
|
<ProjectSession>
|
||||||
<Version Value="11"/>
|
<Version Value="11"/>
|
||||||
<BuildModes Active="Default"/>
|
<BuildModes Active="Default"/>
|
||||||
<Units Count="57">
|
<Units Count="58">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="ExternalPumpBrowser.lpr"/>
|
<Filename Value="ExternalPumpBrowser.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<TopLine Value="44"/>
|
<TopLine Value="235"/>
|
||||||
<CursorPos X="3" Y="171"/>
|
<CursorPos X="6" Y="271"/>
|
||||||
<UsageCount Value="49"/>
|
<UsageCount Value="49"/>
|
||||||
<Bookmarks Count="2">
|
<Bookmarks Count="2">
|
||||||
<Item0 Y="258" ID="3"/>
|
<Item0 Y="273" ID="3"/>
|
||||||
<Item1 X="57" Y="221" ID="1"/>
|
<Item1 X="57" Y="222" ID="1"/>
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
@@ -424,8 +424,16 @@
|
|||||||
<CursorPos X="59" Y="135"/>
|
<CursorPos X="59" Y="135"/>
|
||||||
<UsageCount Value="11"/>
|
<UsageCount Value="11"/>
|
||||||
</Unit56>
|
</Unit56>
|
||||||
|
<Unit57>
|
||||||
|
<Filename Value="../SimpleBrowser2/usimplebrowser2.pas"/>
|
||||||
|
<UnitName Value="uSimpleBrowser2"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="227"/>
|
||||||
|
<CursorPos Y="234"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit57>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="10" HistoryIndex="9">
|
<JumpHistory Count="13" HistoryIndex="12">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="uExternalPumpBrowser.pas"/>
|
<Filename Value="uExternalPumpBrowser.pas"/>
|
||||||
<Caret Line="153" Column="60" TopLine="127"/>
|
<Caret Line="153" Column="60" TopLine="127"/>
|
||||||
@@ -466,6 +474,18 @@
|
|||||||
<Filename Value="uExternalPumpBrowser.pas"/>
|
<Filename Value="uExternalPumpBrowser.pas"/>
|
||||||
<Caret Line="147" Column="16" TopLine="111"/>
|
<Caret Line="147" Column="16" TopLine="111"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
|
<Position11>
|
||||||
|
<Filename Value="uExternalPumpBrowser.pas"/>
|
||||||
|
<Caret Line="172" Column="3" TopLine="128"/>
|
||||||
|
</Position11>
|
||||||
|
<Position12>
|
||||||
|
<Filename Value="uExternalPumpBrowser.pas"/>
|
||||||
|
<Caret Line="197" Column="82" TopLine="190"/>
|
||||||
|
</Position12>
|
||||||
|
<Position13>
|
||||||
|
<Filename Value="uExternalPumpBrowser.pas"/>
|
||||||
|
<Caret Line="62" Column="15" TopLine="45"/>
|
||||||
|
</Position13>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
<RunParams>
|
<RunParams>
|
||||||
<FormatVersion Value="2"/>
|
<FormatVersion Value="2"/>
|
||||||
|
@@ -55,6 +55,7 @@ object Form1: TForm1
|
|||||||
Chromium = Chromium1
|
Chromium = Chromium1
|
||||||
end
|
end
|
||||||
object Chromium1: TChromium
|
object Chromium1: TChromium
|
||||||
|
OnGotFocus = Chromium1GotFocus
|
||||||
OnBeforePopup = Chromium1BeforePopup
|
OnBeforePopup = Chromium1BeforePopup
|
||||||
OnAfterCreated = Chromium1AfterCreated
|
OnAfterCreated = Chromium1AfterCreated
|
||||||
OnBeforeClose = Chromium1BeforeClose
|
OnBeforeClose = Chromium1BeforeClose
|
||||||
|
@@ -65,6 +65,7 @@ type
|
|||||||
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
|
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
|
||||||
procedure Chromium1BeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
|
procedure Chromium1BeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
|
||||||
|
procedure Chromium1GotFocus(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1OpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
procedure Chromium1OpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
||||||
|
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
@@ -245,14 +246,28 @@ begin
|
|||||||
AddressPnl.Enabled := True;
|
AddressPnl.Enabled := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.CEFLinkedWindowParent1Enter(Sender: TObject);
|
// This is a workaround for the CEF issue #2026
|
||||||
begin
|
// https://bitbucket.org/chromiumembedded/cef/issues/2026/multiple-major-keyboard-focus-issues-on
|
||||||
If not(csDesigning in ComponentState) then Chromium1.SetFocus(True);
|
// We use CEFLinkedWindowParent1.OnEnter, CEFLinkedWindowParent1.OnExit and
|
||||||
end;
|
// TChromium.OnGotFocus to avoid most of the focus issues.
|
||||||
|
// CEFLinkedWindowParent1.TabStop must be TRUE.
|
||||||
procedure TForm1.CEFLinkedWindowParent1Exit(Sender: TObject);
|
procedure TForm1.CEFLinkedWindowParent1Exit(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not(csDesigning in ComponentState) then Chromium1.SendCaptureLostEvent;
|
if not(csDesigning in ComponentState) then
|
||||||
|
Chromium1.SendCaptureLostEvent;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.CEFLinkedWindowParent1Enter(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if not(csDesigning in ComponentState) and
|
||||||
|
Chromium1.Initialized and
|
||||||
|
not(Chromium1.FrameIsFocused) then
|
||||||
|
Chromium1.SendFocusEvent(True);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Chromium1GotFocus(Sender: TObject; const browser: ICefBrowser);
|
||||||
|
begin
|
||||||
|
CEFLinkedWindowParent1.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.WMMove(var Message: TLMMove);
|
procedure TForm1.WMMove(var Message: TLMMove);
|
||||||
|
@@ -3,14 +3,14 @@
|
|||||||
<ProjectSession>
|
<ProjectSession>
|
||||||
<Version Value="11"/>
|
<Version Value="11"/>
|
||||||
<BuildModes Active="Default"/>
|
<BuildModes Active="Default"/>
|
||||||
<Units Count="58">
|
<Units Count="62">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="SimpleBrowser2.lpr"/>
|
<Filename Value="SimpleBrowser2.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="18"/>
|
<TopLine Value="18"/>
|
||||||
<CursorPos X="74" Y="42"/>
|
<CursorPos X="74" Y="42"/>
|
||||||
<UsageCount Value="45"/>
|
<UsageCount Value="49"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
@@ -20,11 +20,12 @@
|
|||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="uSimpleBrowser2"/>
|
<UnitName Value="uSimpleBrowser2"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<TopLine Value="113"/>
|
<TopLine Value="225"/>
|
||||||
<CursorPos X="54" Y="135"/>
|
<CursorPos X="57" Y="246"/>
|
||||||
<UsageCount Value="45"/>
|
<UsageCount Value="49"/>
|
||||||
<Bookmarks Count="1">
|
<Bookmarks Count="2">
|
||||||
<Item0 Y="249" ID="3"/>
|
<Item0 X="57" Y="243" ID="3"/>
|
||||||
|
<Item1 Y="239" ID="9"/>
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="Interfaces"/>
|
<UnitName Value="Interfaces"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<UsageCount Value="43"/>
|
<UsageCount Value="47"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="../../../../source/uCEFConstants.pas"/>
|
<Filename Value="../../../../source/uCEFConstants.pas"/>
|
||||||
@@ -142,12 +143,11 @@
|
|||||||
<Unit18>
|
<Unit18>
|
||||||
<Filename Value="../../../source/uCEFChromiumCore.pas"/>
|
<Filename Value="../../../source/uCEFChromiumCore.pas"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="43"/>
|
<TopLine Value="6390"/>
|
||||||
<CursorPos X="59" Y="2566"/>
|
<CursorPos X="25" Y="6396"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="23"/>
|
||||||
<Bookmarks Count="2">
|
<Bookmarks Count="1">
|
||||||
<Item0 Y="2564" ID="1"/>
|
<Item0 Y="4727" ID="2"/>
|
||||||
<Item1 Y="4727" ID="2"/>
|
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
</Unit18>
|
</Unit18>
|
||||||
<Unit19>
|
<Unit19>
|
||||||
@@ -168,9 +168,9 @@
|
|||||||
<Filename Value="/usr/share/lazarus/2.0.10/lcl/controls.pp"/>
|
<Filename Value="/usr/share/lazarus/2.0.10/lcl/controls.pp"/>
|
||||||
<UnitName Value="Controls"/>
|
<UnitName Value="Controls"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="1958"/>
|
<TopLine Value="2223"/>
|
||||||
<CursorPos X="3" Y="1981"/>
|
<CursorPos X="14" Y="2244"/>
|
||||||
<UsageCount Value="14"/>
|
<UsageCount Value="15"/>
|
||||||
</Unit21>
|
</Unit21>
|
||||||
<Unit22>
|
<Unit22>
|
||||||
<Filename Value="/usr/share/lazarus/2.0.10/lcl/lcltype.pp"/>
|
<Filename Value="/usr/share/lazarus/2.0.10/lcl/lcltype.pp"/>
|
||||||
@@ -203,8 +203,7 @@
|
|||||||
<Unit26>
|
<Unit26>
|
||||||
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/gtk2/src/gtk+/gtk/gtkwidget.inc"/>
|
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/gtk2/src/gtk+/gtk/gtkwidget.inc"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="69"/>
|
<CursorPos X="4" Y="5"/>
|
||||||
<CursorPos X="4" Y="96"/>
|
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit26>
|
</Unit26>
|
||||||
<Unit27>
|
<Unit27>
|
||||||
@@ -235,9 +234,9 @@
|
|||||||
<Unit31>
|
<Unit31>
|
||||||
<Filename Value="../../../source/uCEFLinkedWindowParent.pas"/>
|
<Filename Value="../../../source/uCEFLinkedWindowParent.pas"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="51"/>
|
<TopLine Value="48"/>
|
||||||
<CursorPos X="17" Y="73"/>
|
<CursorPos X="69" Y="75"/>
|
||||||
<UsageCount Value="18"/>
|
<UsageCount Value="20"/>
|
||||||
</Unit31>
|
</Unit31>
|
||||||
<Unit32>
|
<Unit32>
|
||||||
<Filename Value="../../../../fpCEF3/cef3lib.pas"/>
|
<Filename Value="../../../../fpCEF3/cef3lib.pas"/>
|
||||||
@@ -249,9 +248,9 @@
|
|||||||
<Unit33>
|
<Unit33>
|
||||||
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/x11/src/xlib.pp"/>
|
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/x11/src/xlib.pp"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="1445"/>
|
<TopLine Value="1285"/>
|
||||||
<CursorPos X="10" Y="1467"/>
|
<CursorPos X="10" Y="1307"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="11"/>
|
||||||
</Unit33>
|
</Unit33>
|
||||||
<Unit34>
|
<Unit34>
|
||||||
<Filename Value="../../../source/uCEFLibFunctions.pas"/>
|
<Filename Value="../../../source/uCEFLibFunctions.pas"/>
|
||||||
@@ -277,8 +276,8 @@
|
|||||||
<Unit37>
|
<Unit37>
|
||||||
<Filename Value="../../../source/uCEFInterfaces.pas"/>
|
<Filename Value="../../../source/uCEFInterfaces.pas"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="2269"/>
|
<TopLine Value="606"/>
|
||||||
<CursorPos X="3" Y="2276"/>
|
<CursorPos X="15" Y="626"/>
|
||||||
<UsageCount Value="16"/>
|
<UsageCount Value="16"/>
|
||||||
</Unit37>
|
</Unit37>
|
||||||
<Unit38>
|
<Unit38>
|
||||||
@@ -332,9 +331,12 @@
|
|||||||
<Unit44>
|
<Unit44>
|
||||||
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/opengles/examples/es2example1.pas"/>
|
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/opengles/examples/es2example1.pas"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="156"/>
|
<TopLine Value="170"/>
|
||||||
<CursorPos X="75" Y="192"/>
|
<CursorPos X="16" Y="228"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="11"/>
|
||||||
|
<Bookmarks Count="1">
|
||||||
|
<Item0 X="47" Y="194" ID="1"/>
|
||||||
|
</Bookmarks>
|
||||||
</Unit44>
|
</Unit44>
|
||||||
<Unit45>
|
<Unit45>
|
||||||
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/x11/src/x.pp"/>
|
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/x11/src/x.pp"/>
|
||||||
@@ -414,7 +416,8 @@
|
|||||||
<Unit55>
|
<Unit55>
|
||||||
<Filename Value="../../../source/uCEFClient.pas"/>
|
<Filename Value="../../../source/uCEFClient.pas"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="61"/>
|
<TopLine Value="622"/>
|
||||||
|
<CursorPos X="21" Y="645"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit55>
|
</Unit55>
|
||||||
<Unit56>
|
<Unit56>
|
||||||
@@ -425,91 +428,87 @@
|
|||||||
<Unit57>
|
<Unit57>
|
||||||
<Filename Value="../../../source/uCEFBrowserProcessHandler.pas"/>
|
<Filename Value="../../../source/uCEFBrowserProcessHandler.pas"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="220"/>
|
<TopLine Value="289"/>
|
||||||
<CursorPos Y="252"/>
|
<CursorPos X="92" Y="323"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit57>
|
</Unit57>
|
||||||
|
<Unit58>
|
||||||
|
<Filename Value="../../../source/uCEFPrintHandler.pas"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="97"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit58>
|
||||||
|
<Unit59>
|
||||||
|
<Filename Value="../../../source/uCEFBrowser.pas"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="487"/>
|
||||||
|
<CursorPos Y="511"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
</Unit59>
|
||||||
|
<Unit60>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/gtk2/examples/gettingstarted/gettingstarted.pas"/>
|
||||||
|
<UnitName Value="GettingStarted"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<CursorPos X="7" Y="6"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit60>
|
||||||
|
<Unit61>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/gtk2/src/gtk2x11/include/gdkx.inc"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="220"/>
|
||||||
|
<CursorPos X="54" Y="232"/>
|
||||||
|
<UsageCount Value="11"/>
|
||||||
|
</Unit61>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="16" HistoryIndex="15">
|
<JumpHistory Count="11" HistoryIndex="10">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="214" Column="47" TopLine="187"/>
|
<Caret Line="245" Column="35" TopLine="242"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="268" Column="61" TopLine="231"/>
|
<Caret Line="257" Column="66" TopLine="231"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="91" TopLine="70"/>
|
<Caret Line="75" Column="15" TopLine="68"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="211" TopLine="187"/>
|
<Caret Line="286" Column="59" TopLine="251"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="265" Column="85" TopLine="229"/>
|
<Caret Line="264" TopLine="252"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="266" TopLine="229"/>
|
<Caret Line="76" Column="37" TopLine="39"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="219" Column="5" TopLine="193"/>
|
<Caret Line="275" TopLine="251"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="119" Column="67" TopLine="36"/>
|
<Caret Line="250" Column="66" TopLine="236"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="85" Column="35" TopLine="70"/>
|
<Caret Line="89" TopLine="68"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="63" Column="27" TopLine="53"/>
|
<Caret Line="239" TopLine="234"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
<Filename Value="usimplebrowser2.pas"/>
|
||||||
<Caret Line="216" Column="5" TopLine="197"/>
|
<Caret Line="76" Column="38" TopLine="51"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
|
||||||
<Caret Line="137" Column="43" TopLine="101"/>
|
|
||||||
</Position12>
|
|
||||||
<Position13>
|
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
|
||||||
<Caret Line="139" TopLine="101"/>
|
|
||||||
</Position13>
|
|
||||||
<Position14>
|
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
|
||||||
<Caret Line="135" TopLine="125"/>
|
|
||||||
</Position14>
|
|
||||||
<Position15>
|
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
|
||||||
<Caret Line="140" TopLine="125"/>
|
|
||||||
</Position15>
|
|
||||||
<Position16>
|
|
||||||
<Filename Value="usimplebrowser2.pas"/>
|
|
||||||
<Caret Line="145" TopLine="125"/>
|
|
||||||
</Position16>
|
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
<RunParams>
|
<RunParams>
|
||||||
<FormatVersion Value="2"/>
|
<FormatVersion Value="2"/>
|
||||||
<Modes Count="0" ActiveMode=""/>
|
<Modes Count="0" ActiveMode=""/>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
</ProjectSession>
|
</ProjectSession>
|
||||||
<Debugging>
|
|
||||||
<BreakPoints Count="1">
|
|
||||||
<Item1>
|
|
||||||
<Kind Value="bpkSource"/>
|
|
||||||
<WatchScope Value="wpsLocal"/>
|
|
||||||
<WatchKind Value="wpkWrite"/>
|
|
||||||
<Source Value="../../../../source/uCEFChromiumCore.pas"/>
|
|
||||||
<Line Value="4373"/>
|
|
||||||
</Item1>
|
|
||||||
</BreakPoints>
|
|
||||||
</Debugging>
|
|
||||||
</CONFIG>
|
</CONFIG>
|
||||||
|
@@ -30,6 +30,7 @@ object Form1: TForm1
|
|||||||
Align = alRight
|
Align = alRight
|
||||||
Caption = 'Go'
|
Caption = 'Go'
|
||||||
OnClick = GoBtnClick
|
OnClick = GoBtnClick
|
||||||
|
OnEnter = CEFLinkedWindowParent1Exit
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object AddressEdt: TEdit
|
object AddressEdt: TEdit
|
||||||
@@ -38,6 +39,7 @@ object Form1: TForm1
|
|||||||
Top = 0
|
Top = 0
|
||||||
Width = 932
|
Width = 932
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
OnEnter = CEFLinkedWindowParent1Exit
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Text = 'https://www.google.com'
|
Text = 'https://www.google.com'
|
||||||
end
|
end
|
||||||
@@ -55,6 +57,7 @@ object Form1: TForm1
|
|||||||
Chromium = Chromium1
|
Chromium = Chromium1
|
||||||
end
|
end
|
||||||
object Chromium1: TChromium
|
object Chromium1: TChromium
|
||||||
|
OnGotFocus = Chromium1GotFocus
|
||||||
OnBeforePopup = Chromium1BeforePopup
|
OnBeforePopup = Chromium1BeforePopup
|
||||||
OnAfterCreated = Chromium1AfterCreated
|
OnAfterCreated = Chromium1AfterCreated
|
||||||
OnBeforeClose = Chromium1BeforeClose
|
OnBeforeClose = Chromium1BeforeClose
|
||||||
|
@@ -58,13 +58,11 @@ type
|
|||||||
AddressPnl: TPanel;
|
AddressPnl: TPanel;
|
||||||
Timer1: TTimer;
|
Timer1: TTimer;
|
||||||
|
|
||||||
procedure CEFLinkedWindowParent1Enter(Sender: TObject);
|
|
||||||
procedure CEFLinkedWindowParent1Exit(Sender: TObject);
|
|
||||||
|
|
||||||
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
|
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
|
||||||
procedure Chromium1BeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
|
procedure Chromium1BeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
|
||||||
|
procedure Chromium1GotFocus(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1OpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
procedure Chromium1OpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
||||||
|
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
@@ -73,6 +71,9 @@ type
|
|||||||
|
|
||||||
procedure GoBtnClick(Sender: TObject);
|
procedure GoBtnClick(Sender: TObject);
|
||||||
procedure Timer1Timer(Sender: TObject);
|
procedure Timer1Timer(Sender: TObject);
|
||||||
|
|
||||||
|
procedure CEFLinkedWindowParent1Enter(Sender: TObject);
|
||||||
|
procedure CEFLinkedWindowParent1Exit(Sender: TObject);
|
||||||
private
|
private
|
||||||
|
|
||||||
protected
|
protected
|
||||||
@@ -230,14 +231,28 @@ begin
|
|||||||
SendCompMessage(CEF_AFTERCREATED);
|
SendCompMessage(CEF_AFTERCREATED);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.CEFLinkedWindowParent1Enter(Sender: TObject);
|
// This is a workaround for the CEF issue #2026
|
||||||
begin
|
// https://bitbucket.org/chromiumembedded/cef/issues/2026/multiple-major-keyboard-focus-issues-on
|
||||||
If not(csDesigning in ComponentState) then Chromium1.SetFocus(True);
|
// We use CEFLinkedWindowParent1.OnEnter, CEFLinkedWindowParent1.OnExit and
|
||||||
end;
|
// TChromium.OnGotFocus to avoid most of the focus issues.
|
||||||
|
// CEFLinkedWindowParent1.TabStop must be TRUE.
|
||||||
procedure TForm1.CEFLinkedWindowParent1Exit(Sender: TObject);
|
procedure TForm1.CEFLinkedWindowParent1Exit(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not(csDesigning in ComponentState) then Chromium1.SendCaptureLostEvent;
|
if not(csDesigning in ComponentState) then
|
||||||
|
Chromium1.SendCaptureLostEvent;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.CEFLinkedWindowParent1Enter(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if not(csDesigning in ComponentState) and
|
||||||
|
Chromium1.Initialized and
|
||||||
|
not(Chromium1.FrameIsFocused) then
|
||||||
|
Chromium1.SendFocusEvent(True);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Chromium1GotFocus(Sender: TObject; const browser: ICefBrowser);
|
||||||
|
begin
|
||||||
|
CEFLinkedWindowParent1.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.BrowserCreatedMsg(Data: PtrInt);
|
procedure TForm1.BrowserCreatedMsg(Data: PtrInt);
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<ProjectSession>
|
<ProjectSession>
|
||||||
<Version Value="11"/>
|
<Version Value="11"/>
|
||||||
<BuildModes Active="Default"/>
|
<BuildModes Active="Default"/>
|
||||||
<Units Count="58">
|
<Units Count="59">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="SubProcess.lpr"/>
|
<Filename Value="SubProcess.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@@ -20,11 +20,11 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<TopLine Value="95"/>
|
<TopLine Value="50"/>
|
||||||
<CursorPos X="31" Y="109"/>
|
<CursorPos Y="61"/>
|
||||||
<UsageCount Value="46"/>
|
<UsageCount Value="46"/>
|
||||||
<Bookmarks Count="1">
|
<Bookmarks Count="1">
|
||||||
<Item0 Y="235" ID="3"/>
|
<Item0 Y="250" ID="3"/>
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
@@ -436,8 +436,16 @@
|
|||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit57>
|
</Unit57>
|
||||||
|
<Unit58>
|
||||||
|
<Filename Value="../SimpleBrowser2/usimplebrowser2.pas"/>
|
||||||
|
<UnitName Value="uSimpleBrowser2"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="53"/>
|
||||||
|
<CursorPos X="60" Y="73"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit58>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="25" HistoryIndex="24">
|
<JumpHistory Count="28" HistoryIndex="27">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="../../../source/uCEFMiscFunctions.pas"/>
|
<Filename Value="../../../source/uCEFMiscFunctions.pas"/>
|
||||||
<Caret Line="1613" TopLine="1591"/>
|
<Caret Line="1613" TopLine="1591"/>
|
||||||
@@ -538,6 +546,18 @@
|
|||||||
<Filename Value="../../../source/uCEFMiscFunctions.pas"/>
|
<Filename Value="../../../source/uCEFMiscFunctions.pas"/>
|
||||||
<Caret Line="2950" TopLine="2928"/>
|
<Caret Line="2950" TopLine="2928"/>
|
||||||
</Position25>
|
</Position25>
|
||||||
|
<Position26>
|
||||||
|
<Filename Value="uSubProcess.pas"/>
|
||||||
|
<Caret Line="110" Column="31" TopLine="96"/>
|
||||||
|
</Position26>
|
||||||
|
<Position27>
|
||||||
|
<Filename Value="uSubProcess.pas"/>
|
||||||
|
<Caret Line="171" Column="6" TopLine="162"/>
|
||||||
|
</Position27>
|
||||||
|
<Position28>
|
||||||
|
<Filename Value="uSubProcess.pas"/>
|
||||||
|
<Caret Line="62" Column="15" TopLine="45"/>
|
||||||
|
</Position28>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
<RunParams>
|
<RunParams>
|
||||||
<FormatVersion Value="2"/>
|
<FormatVersion Value="2"/>
|
||||||
|
@@ -55,6 +55,7 @@ object Form1: TForm1
|
|||||||
Chromium = Chromium1
|
Chromium = Chromium1
|
||||||
end
|
end
|
||||||
object Chromium1: TChromium
|
object Chromium1: TChromium
|
||||||
|
OnGotFocus = Chromium1GotFocus
|
||||||
OnBeforePopup = Chromium1BeforePopup
|
OnBeforePopup = Chromium1BeforePopup
|
||||||
OnAfterCreated = Chromium1AfterCreated
|
OnAfterCreated = Chromium1AfterCreated
|
||||||
OnBeforeClose = Chromium1BeforeClose
|
OnBeforeClose = Chromium1BeforeClose
|
||||||
|
@@ -58,13 +58,11 @@ type
|
|||||||
AddressPnl: TPanel;
|
AddressPnl: TPanel;
|
||||||
Timer1: TTimer;
|
Timer1: TTimer;
|
||||||
|
|
||||||
procedure CEFLinkedWindowParent1Enter(Sender: TObject);
|
|
||||||
procedure CEFLinkedWindowParent1Exit(Sender: TObject);
|
|
||||||
|
|
||||||
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
|
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
|
||||||
procedure Chromium1BeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
|
procedure Chromium1BeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
|
||||||
|
procedure Chromium1GotFocus(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1OpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
procedure Chromium1OpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
||||||
|
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
@@ -73,6 +71,9 @@ type
|
|||||||
|
|
||||||
procedure GoBtnClick(Sender: TObject);
|
procedure GoBtnClick(Sender: TObject);
|
||||||
procedure Timer1Timer(Sender: TObject);
|
procedure Timer1Timer(Sender: TObject);
|
||||||
|
|
||||||
|
procedure CEFLinkedWindowParent1Enter(Sender: TObject);
|
||||||
|
procedure CEFLinkedWindowParent1Exit(Sender: TObject);
|
||||||
private
|
private
|
||||||
|
|
||||||
protected
|
protected
|
||||||
@@ -216,14 +217,28 @@ begin
|
|||||||
SendCompMessage(CEF_AFTERCREATED);
|
SendCompMessage(CEF_AFTERCREATED);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.CEFLinkedWindowParent1Enter(Sender: TObject);
|
// This is a workaround for the CEF issue #2026
|
||||||
begin
|
// https://bitbucket.org/chromiumembedded/cef/issues/2026/multiple-major-keyboard-focus-issues-on
|
||||||
If not(csDesigning in ComponentState) then Chromium1.SetFocus(True);
|
// We use CEFLinkedWindowParent1.OnEnter, CEFLinkedWindowParent1.OnExit and
|
||||||
end;
|
// TChromium.OnGotFocus to avoid most of the focus issues.
|
||||||
|
// CEFLinkedWindowParent1.TabStop must be TRUE.
|
||||||
procedure TForm1.CEFLinkedWindowParent1Exit(Sender: TObject);
|
procedure TForm1.CEFLinkedWindowParent1Exit(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not(csDesigning in ComponentState) then Chromium1.SendCaptureLostEvent;
|
if not(csDesigning in ComponentState) then
|
||||||
|
Chromium1.SendCaptureLostEvent;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.CEFLinkedWindowParent1Enter(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if not(csDesigning in ComponentState) and
|
||||||
|
Chromium1.Initialized and
|
||||||
|
not(Chromium1.FrameIsFocused) then
|
||||||
|
Chromium1.SendFocusEvent(True);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Chromium1GotFocus(Sender: TObject; const browser: ICefBrowser);
|
||||||
|
begin
|
||||||
|
CEFLinkedWindowParent1.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.BrowserCreatedMsg(Data: PtrInt);
|
procedure TForm1.BrowserCreatedMsg(Data: PtrInt);
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : true,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 218,
|
"InternalVersion" : 219,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "87.1.12.0"
|
"Version" : "87.1.12.0"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user