You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-12-03 21:44:45 +02:00
Added the PopupBrowser2 demo for Linux
Set the CEFLinkedWindowParent1.TabStop to true to fix a focus issue Moved TCEFLinkedWindowParent.UpdateSize to the public section
This commit is contained in:
@@ -309,18 +309,29 @@ begin
|
||||
SendCompMessage(CEF_AFTERCREATED);
|
||||
end;
|
||||
|
||||
// This is a workaround for the CEF issue #2026
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2026/multiple-major-keyboard-focus-issues-on
|
||||
// We use CEFLinkedWindowParent1.OnEnter, CEFLinkedWindowParent1.OnExit and
|
||||
// TChromium.OnGotFocus to avoid most of the focus issues.
|
||||
// CEFLinkedWindowParent1.TabStop must be TRUE.
|
||||
procedure TBrowserFrame.CEFLinkedWindowParent1Exit(Sender: TObject);
|
||||
begin
|
||||
if not(csDesigning in ComponentState) then
|
||||
Chromium1.SendCaptureLostEvent;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.CEFLinkedWindowParent1Enter(Sender: TObject);
|
||||
begin
|
||||
if not(csDesigning in ComponentState) and
|
||||
Chromium1.Initialized and
|
||||
not(Chromium1.FrameIsFocused) then
|
||||
Chromium1.SendFocusEvent(True);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.CEFLinkedWindowParent1Exit(Sender: TObject);
|
||||
procedure TBrowserFrame.Chromium1GotFocus(Sender: TObject;
|
||||
const browser: ICefBrowser);
|
||||
begin
|
||||
if not(csDesigning in ComponentState) then
|
||||
Chromium1.SendCaptureLostEvent;
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.BackBtnClick(Sender: TObject);
|
||||
@@ -360,12 +371,6 @@ begin
|
||||
aAction := cbaClose;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.Chromium1GotFocus(Sender: TObject;
|
||||
const browser: ICefBrowser);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.Chromium1LoadError(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer;
|
||||
const errorText, failedUrl: ustring);
|
||||
@@ -431,7 +436,8 @@ var
|
||||
begin
|
||||
TempURL := BrowserAddress;
|
||||
|
||||
if (URLCbx.Items.IndexOf(TempURL) < 0) then URLCbx.Items.Add(TempURL);
|
||||
if (URLCbx.Items.IndexOf(TempURL) < 0) then
|
||||
URLCbx.Items.Add(TempURL);
|
||||
|
||||
URLCbx.Text := TempURL;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user