diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index 4cae260f64..00547c0448 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -4571,6 +4571,7 @@ begin {$IFDEF VerboseFocus} DebugLn('[TCustomSynEdit.WMSetFocus] A ',Name,':',ClassName); {$ENDIF} + FScreenCaret.DestroyCaret; // Ensure recreation. On Windows only one caret exists, and it must be moved to the focused editor FScreenCaret.Visible := True; //if FHideSelection and SelAvail then // Invalidate; diff --git a/components/synedit/syneditpointclasses.pas b/components/synedit/syneditpointclasses.pas index 6e27f76493..305556e7bf 100644 --- a/components/synedit/syneditpointclasses.pas +++ b/components/synedit/syneditpointclasses.pas @@ -1548,6 +1548,7 @@ end; constructor TSynEditScreenCaret.Create(AHandle: HWND); begin inherited Create; + FPersistentCaret := False; FHandle := AHandle; FVisible := False; FCurrentVisible := False; @@ -1687,10 +1688,14 @@ end; procedure TSynEditScreenCaret.SetPersistentCaret(const AValue: Boolean); begin - if FPersistentCaret = AValue then exit; - FPersistentCaret := AValue; - if FCurrentCreated then - SetCaretRespondToFocus(Handle, not FPersistentCaret); + (* Do nothing, keep Value always False. + Most Widgetsets do not even implement it. SynEdit handles it in WMSetFocus/WMKillFocus + QT goes weird, if it is set + *) + //if FPersistentCaret = AValue then exit; + //FPersistentCaret := AValue; + //if FCurrentCreated then + // SetCaretRespondToFocus(Handle, not FPersistentCaret); end; procedure TSynEditScreenCaret.SetClipBottom(const AValue: Integer);