diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index c08d4e67d4..d464250b63 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -7111,10 +7111,8 @@ begin // (un)register HWND as drop target if (eoDropFiles in ChangedOptions) and not (csDesigning in ComponentState) and HandleAllocated then ; // ToDo DragAcceptFiles - if (eoPersistentCaret in ChangedOptions) and HandleAllocated then begin - FScreenCaret.PersistentCaret := eoPersistentCaret in fOptions; + if (eoPersistentCaret in ChangedOptions) and HandleAllocated then UpdateCaret; - end; if (eoShowSpecialChars in ChangedOptions) and HandleAllocated then Invalidate; diff --git a/components/synedit/syneditpointclasses.pas b/components/synedit/syneditpointclasses.pas index 911d8a1d47..0d8f16f716 100644 --- a/components/synedit/syneditpointclasses.pas +++ b/components/synedit/syneditpointclasses.pas @@ -273,7 +273,6 @@ type {$IFDeF SynCaretDebug} FDebugShowCount: Integer; {$ENDIF} - FPersistentCaret: Boolean; FPixelWidth, FPixelHeight: Integer; FOffsetX, FOffsetY: Integer; FCurrentPosX, FCurrentPosY: Integer; @@ -286,7 +285,6 @@ type procedure SetClipRect(const AValue: TRect); procedure SetClipTop(const AValue: Integer); procedure SetHandle(const AValue: HWND); - procedure SetPersistentCaret(const AValue: Boolean); procedure UpdateDisplayType; procedure UpdateDisplay; procedure ShowCaret; @@ -312,7 +310,6 @@ type property ExtraLineChars: Integer read FExtraLineChars; // Extend the longest line by x chars property OnExtraLineCharsChanged: TNotifyEvent read FOnExtraLineCharsChanged write FOnExtraLineCharsChanged; - property PersistentCaret: Boolean read FPersistentCaret write SetPersistentCaret; end; implementation @@ -1554,7 +1551,6 @@ end; constructor TSynEditScreenCaret.Create(AHandle: HWND); begin inherited Create; - FPersistentCaret := False; FHandle := AHandle; FVisible := False; FCurrentVisible := False; @@ -1700,18 +1696,6 @@ begin UpdateDisplay; end; -procedure TSynEditScreenCaret.SetPersistentCaret(const AValue: Boolean); -begin - (* 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); begin if FClipBottom = AValue then exit; @@ -1789,7 +1773,11 @@ begin FCurrentVisible := False; FCurrentClippedWidth := w; FCurrentPosX := x - 1; - SetCaretRespondToFocus(Handle, not FPersistentCaret); + {$IFDEF LCLQT} + SetCaretRespondToFocus(Handle, True); // See bug 17173 + {$ELSE} + SetCaretRespondToFocus(Handle, False); // Only for GTK + {$ENDIF} end; if (x <> FCurrentPosX) or (y <> FCurrentPosY) then begin {$IFDeF SynCaretDebug}