Skip to content

Commit

Permalink
avoid flicker with white on app startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Dec 19, 2024
1 parent b16dbac commit 17525a9
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion atsynedit/atsynedit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -6476,8 +6476,23 @@ procedure TATSynEdit.DoContextPopup(MousePos: TPoint; var Handled: Boolean);
end;

procedure TATSynEdit.WMEraseBkgnd(var Msg: TLMEraseBkgnd);
var
R: TRect;
begin
//needed to remove flickering on resize and mouse-over
//to avoid flickering with white on app startup
{$ifdef windows}
if Msg.DC<>0 then
begin
Brush.Color:= Colors.TextBG;
R.Left:= 0;
R.Top:= 0;
R.Width:= Width;
R.Height:= Height;
Windows.FillRect(Msg.DC, R, Brush.Reference.Handle);
end;
{$endif}

//to remove flickering on resize and mouse-over
Msg.Result:= 1;
end;

Expand Down

0 comments on commit 17525a9

Please sign in to comment.