Everything freezes when resizing
Posted: Tue Apr 22, 2025 8:59 am
I have TCEFWindowParent and TChromium on the form, and I'm handling the ChromiumKeyEvent
[CEF4Delphi uses CEF 135.0.17 which includes Chromium 135.0.7049.52]
Code: Select all
...
if event^.kind = KEYEVENT_RAWKEYDOWN then
begin
//Ctrl + Shift + L
if ((event^.modifiers and EVENTFLAG_CONTROL_DOWN) <> 0) and
((event^.modifiers and EVENTFLAG_SHIFT_DOWN) <> 0) and
(event^.windows_key_code = Ord('L')) then
begin
Result := True;
PanelEditVisibleChange; //Everything freezes when resizing — the only option is to kill the process.
end;
end;
...
procedure TWebForm.PanelEditVisibleChange;
var
vis: Boolean;
begin
CEFWindowParent.Visible := False;
Application.ProcessMessages;
//if Assigned(Chromium.Browser) then
// Chromium.Browser.Host.NotifyMoveOrResizeStarted;
vis := not(pnlEdit.Visible);
if vis then begin
//FOrigWidth := Self.Width;
Self.Width := FOrigWidth + pnlEdit.Width + spHaupt.Width;
pnlEdit.Visible := vis;
spHaupt.Visible := vis;
spHaupt.Left := pnlEdit.Left - spHaupt.Width - 10;
end
else
begin
spHaupt.Visible := vis;
pnlEdit.Visible := vis;
//FOrigWidth := Self.Width;
Self.Width := FOrigWidth;
end;
CEFWindowParent.Visible := True;
end;